我不知道 你是要这种效果吗[code=java]import java.util.regex.Pattern ;
import java.util.regex.Matcher ;
public class RegexDemo04{
public static void main(String args[]){
String info1 = "/com/submit";
String info2 = "\\com\\submit";
String s1[] = info1.split("/");
String s2[] = info2.split("\\\\");
System.out.println("字符串/com/submit截取后为:");
for (int i = 0;i<s1.length ; i++ ){
System.out.print(s1[i]+ " ");
}
System.out.println("");
System.out.println("字符串\\com\\submit截取后为:");
for (int i = 0;i<s1.length ; i++ ){
System.out.print(s2[i]+ " ");
}
}
}[/code] |