String phone = "010-1234567";String[] result = phone.split("-");String prev = result[0];String next = result[1];