split按照两个或多个关键字来截取字符穿,str.split([??])
按照#@分割one123#tow456@three7890字符串分割结果为one123tow456three7890
public class Test01 { public static void main(String[] args) { String str = "one123#tow456@three7890"; String[] strs = str.split([#@]); for(int i = 0; i < strs.length; i++) { System.out.printf("strs[%d] = %s%n", i, strs); } } }
黑色头发:http://heisetoufa.iteye.com
页:
[1]