日期:2014-05-16 浏览次数:20955 次
public class tt {
public static void main(String[] args) {
List<String> str = new LinkedList<String>();
str.add("2");
str.add("2");
str.add("3");
str.add("2");
str.add("6");
str.add("7");
str.add("你好");
str.add("9");
str.remove(2);//默认编号从0开始,删第3个就是str.remove(2)
System.out.println(str);
}
}
str="2,2,3,2,6,7,你好,9"
newstr = del(str, 7, ",")
function del(list, pos, delimeter)
ar = split(list,delimeter)
ar(pos-1)=delimeter
s = join(ar,delimeter)
s = replace(s, delimeter & delimeter, delimeter)
s = replace(s, delimeter & delimeter, delimeter)
del = replace(replace(trim(replace(replace(s," ","[space]"),delimeter," "))," ", delimeter),"[space]"," ")
end function