problem while converting String to List in Java..
I am trying to convert the below string to a list in Java, but its taking as a single object, I need four separate obejcts.
String:
button 1 of window "abc" of application process "xyz" button 2 of window "abc" of application process "xyz" button 3 of window "abc" of application process "xyz" button "Finish" of UI element 1 of scroll area 1 of window "abc" of application process "xyz"
Java code used:
List<String> items = Arrays.asList(resultObject.toString().split("\\s*,\\s*"));
List<String> formattedList = new ArrayList<String>();
for (String item : items) {
formattedList.add(item);
}
Expected Output:
similar to string but in four different list objects
item1 : button 1 of window "abc" of application process "xyz"
item2 :button 2 of window "abc" of application process "xyz"
item3: button 3 of window "abc" of application process "xyz"
item4 :button "Finish" of UI element 1 of scroll area 1 of window "abc" of application process "xyz"
Mac OS X (10.7.4)