public class List {
public static void main(String[] args) {
String s = "abc nnn ooo/xzsxc bs";
System.out.println("原字符串:"+s);
System.out.println();
String a[] = s.split(" ");
ArrayList b = new ArrayList();
for (int i = 0; i < a.length;i++){
b.add(a[i]);
System.out.println(a[i]);
}
System.out.println();
for( int i=0;i<a.length;i++ ){
a[i] = a[i].replaceAll(a[i],"/"+ a[i] + "/");
System.out.println(a[i]);
}
}
}
posted on 2018-05-31 09:33  背起全世界の蜗牛  阅读(1036)  评论(0编辑  收藏  举报