????java?г?????????????????
????1??length() ??????????
????????char chars[]={'a'??'b'.'c'};
????String s=new String(chars);
????int len=s.length();
????2??charAt() ?????????
????????char ch;
????ch="abc".charAt(1); ????'b'
????3??getChars() ?????????
????void getChars(int sourceStart??int sourceEnd??char target[]??int targetStart)
????sourceStart?????????????????±?sourceEnd??????????????????????????±??????????????sourceStart??sourceEnd-1??????????????????????target?????target?п????????????±????targetStart??
????????String s="this is a demo of the getChars method.";
????char buf[]=new char[20];
????s.getChars(10??14??buf??0);
????4??getBytes()
???????getChars()???????????????洢??????????У??÷?????getBytes()??
????5??toCharArray()
????6??equals()??equalsIgnoreCase() ????????????
????7??regionMatches()???????????????????????????????????????????????????????????к????Сд??
????boolean regionMatches(int startIndex??String str2??int str2StartIndex??int numChars)
????boolean regionMatches(boolean ignoreCase??int startIndex??String str2??int str2StartIndex??int numChars)
????8??startsWith()??endsWith()
????startsWith()??????????????????????????endWith()?????????????????????????
????9??equals()??==
????equals()?????????????????е??????==??????????????????????????????
????????String s1="Hello";
????String s2=new String(s1);
????s1.eauals(s2); //true
????s1==s2;//false
????10??compareTo()??compareToIgnoreCase() ????????
????11??indexOf()??lastIndexOf()
????indexOf() ??????????????????γ????????
????lastIndexOf() ??????????????????γ????????
????12??substring()
?????????????????????????String substring(int startIndex)
????????????String substring(int startIndex??int endIndex)