Introduction to common methods of string API

1)char charAt (int index)

2)int codePointAt(int index) 5.0

3)int offsetByCodePoints(int startIndex,int cpCount) 5.0

4)int compareTo(String other)

5)IntStream codePoints() 8

6) new String(int[] codePoints,int offset,int count) 5.0

7)boolean equals(Object other)

8)boolean equalsIgnoreCase(String other)

9)boolean startsWith(String prefix)

10)boolean endsWith(String suffix)

11)int indexOf(String str)

12)int indexOf(String str,int fromIndex)

13)int indexOf(int cp)

14)int indexOf(int cp,int fromIndex)

15)int lastIndexOf(String str)

16)int lastIndexOf(String str,int fromIndex)

17)int lastIndexOf(int cp)

18)int lastIndexOf(int cp,int fromIndex)

19)int length()

20)int codePointCount(int startIndex,int endIndex) 5.0

21)String replace(CharSequence oldString,CharSequence newString)

22)String substring(int beginIndex)

23)String substring(int beginIndex,int endIndex)

24)String toLowerCase()

25)String toUpperCase()

26)String trim()

27)String join(CharSequence delimiter,CharSequence... elements) 8

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>