例如
String temp = "welcome,to,the,world,of,j2ee";
将此转换为arraylist
ArrayList al= new ArrayList(temp.split(","));
这是作为arraylist的内容 {"welcome","to","the","world","j2ee"}
我的要求是在每个字符串的末尾添加“ ^ d”
对于前 {"welcome^d","to^d","the^d","world^d","j2ee^d"}
尝试这个:
List<String> al= Arrays.asList((temp.replaceAll(",", "^d,") + "^d").split(","));
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句