- 论坛徽章:
- 0
|
菜鸟提问:一个关于在java中处理字符串的问题?
strSource = strSource.replace(" ","\n"
String replace(char oldChar, char newChar)
Returns a new string resulting from replacing all occurrences of oldChar in this string with newChar.
String replace(CharSequence target, CharSequence replacement)
Replaces each substring of this string that matches the literal target sequence with the specified literal replacement sequence.
String replaceAll(String regex, String replacement)
Replaces each substring of this string that matches the given regular expression with the given replacement. |
|