package project0;
//import java.util.*;
public class sort {
public static void main(String []args)
{
String str1=" dsjar [] sss ajs ,ad [[ s";//去除首尾字符串空格
System.out.println(str1.trim());
//去除字符串中的所有空格符
System.out.println(str1.replaceAll("\s",""));
}
}
相关文章: