版权声明:本文为博主原创文章,欢迎转载,转载请标明出处。 https://blog.csdn.net/qq_32523587/article/details/86555452
目录
codePointCount(int beginIndex, int endIndex)
getChars(char dst[], int dstBegin)
getChars(int srcBegin, int srcEnd, char dst[], int dstBegin)
codePointAt(int index)
作用:获取String中指定位置的代码点。
codePointBefore(int index)
作用:获取String中指定位置前一位的代码点。
其中,codePointBeforeImpl(char[] a, int index, int start)方法如下:
codePointCount(int beginIndex, int endIndex)
作用:获取String指定范围内的代码点个数。
getChars(char dst[], int dstBegin)
作用:将String的所有内容复制到char dst[]的指定位置后面。该方法不作范围检查。
getChars(int srcBegin, int srcEnd, char dst[], int dstBegin)
作用:将String的内容复制到char dst[]里去。
getBytes(String charsetName)
作用:使用指定的字符集,获取String对应的字符数组。
getBytes(Charset charset)
作用:与上一个方法作用相同,不同之处在于,字符集的格式是Charset类型的。
getBytes()
作用:使用默认的字符集,获取String对应的字符数组。
equals(Object anObject)
作用:比较当前String和指定的Object anObject是否相等。