java.lang 类String

方法摘要
1  char
    charAt(int index)

           返回指定索引处的 char 值。
               index - char 值的索引。
2 string
       concat(String str) 
          将指定字符串连接到此字符串的结尾。
                 str - 连接到此 String 结尾的 String。 

        substring(int beginIndex) 
          返回一个新的字符串,它是此字符串的一个子字符串。
            beginIndex - 起始索引(包括)。
3  boolean 
        endsWith(String suffix) 
          测试此字符串是否以指定的后缀结束。 
              suffix - 后缀。 

        startsWith(String prefix) 
          测试此字符串是否以指定的前缀开始。
 
       equals(Object anObject) 
          将此字符串与指定的对象比较。
         anObject - 与此 String 进行比较的对象

        equalsIgnoreCase(String anotherString) 
          将此 String 与另一个 String 比较,不考虑大小写。
          anotherString - 与此 String 进行比较的 String。 

4 int
       indexOf(int ch) 
          返回指定字符在此字符串中第一次出现处的索引。
             ch - 一个字符

        indexOf(int ch, int fromIndex) 
          返回在此字符串中第一次出现指定字符处的索引,从指定的索引开始搜索。
          ch - 一个字符   fromIndex - 开始搜索的索引。

        indexOf(String str) 
          返回指定子字符串在此字符串中第一次出现处的索引。
         str-任意字符串

        indexOf(String str, int fromIndex) 
          返回指定子字符串在此字符串中第一次出现处的索引,从指定的索引开始。
          str - 要搜索的子字符串。fromIndex - 开始搜索的索引位置。
     public int lastIndexOf(int ch) 
    public int lastIndexOf(iint ch, int fromIndex)  
    public int lastIndexOf(String str) 
    public int lastIndexOf(String str, int fromIndex)    

     length() 
          返回此字符串的长度。

 

   未完待续。。。。。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值