I have a String add as Phenix City, AL 36867. I want to eventually have 3 java Strings: city, state, zip corresponding to the values.
What I have kind of works but is very complicated. Split the string by a comma
String[] halves = add.split(",");
String city = halves[0].replace(",","").trim();
and then screw around with the remainder
String remainder = halves[1].trim();
String[] fields = remainder.split("");
String state = fields[0];
String zip = fields[1];
but it seems like there must be a more elegant way?