方法
- append(string s)
- reverse()
- public insert(int offset, int i)
將 int 參數(shù)的字符串表示形式插入此序列中 - replace(int start, int end, String str)
使用給定 String 中的字符替換此序列的子字符串中的字符。
與string類似的方法
- int capacity() 返回當(dāng)前容量
- char charAt(int index)
返回此序列中指定索引處的 char 值 - void ensureCapacity(int minimumCapacity)
確保容量至少等于指定的最小值 - oid getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)
將字符從此序列復(fù)制到目標(biāo)字符數(shù)組 dst - int indexOf(String str)
返回第一次出現(xiàn)的指定子字符串在該字符串中的索引 - int indexOf(String str, int fromIndex)
從指定的索引處開始,返回第一次出現(xiàn)的指定子字符串在該字符串中的索引 - int length()
返回長度(字符數(shù)) - String substring(int start)
返回一個新的 String,它包含此字符序列當(dāng)前所包含的字符子序列。 - String substring(int start, int end)
返回一個新的 String,它包含此序列當(dāng)前所包含的字符子序列。 - String toString()
返回此序列中數(shù)據(jù)的字符串表示形式