Java示例拆分字符串 Java示例在String对象中搜索 Java示例字符串拆分 Java示例拆分字符串 public class JavaStringSplitEmp{ public static void main(String args[]) { String str = "jan-feb-march"; String[] temp; String delimeter = "-"; temp = str.split(delimeter); for(int i = 0; i < temp.length; i++) { System.out.println(temp[i]); System.out.println(""); str = "jan.feb.march"; delimeter = "\\."; temp = str.split(delimeter); } for(int i =0; i < temp.length; i++) { System.out.println(temp[i]); System.out.println(""); temp = str.split(delimeter,2); for(int j = 0; j < temp.length; j++){ System.out.println(temp[j]); } } } } Java示例在String对象中搜索 Java示例字符串拆分