去掉字符串中空格:
替换字符串中指定字符为指定字符
黑色头发:http://heisetoufa.iteye.com/
public static void main(String args[])
{
String str = "a b c d e f";
String test = str.replaceAll("\\s{1,}", "");
System.out.println(test);
}
替换字符串中指定字符为指定字符
public static void main(String args[])
{
String str = "aaaaaaaaabbbbbbaaaaaaaa";
String test = str.replaceAll("b", "c");
System.out.println(test);
}
黑色头发:http://heisetoufa.iteye.com/