单选题:要去除字符串" i t c a s t "中的所有空格,用以下哪种方法更合适()
要去除字符串" i t c a s t "中的所有空格,用以下哪种方法更合适()
A.String substring(int beginIndex)
B.String substring(int beginIndex, int endIndex)
C.String replace(CharSequence oldstr, CharSequence newstr)
D.String trim()
答案:C
A.String substring(int beginIndex)
B.String substring(int beginIndex, int endIndex)
C.String replace(CharSequence oldstr, CharSequence newstr)
D.String trim()
答案:C