public class Main { public static void main(String args[]) { String str = "one.two.three"; String delimeter = "\\."; String[] temp = str.split(delimeter, 2); for (int i = 0; i < temp.length; i++) { System.out.println(temp[i]); } } }