[Solved] How to convert String into String Array in Java? [duplicate]


Split on “,”.

String st = "Tokyo, New York, Amsterdam"
String[] arr = st.split(",");

If st has ‘{‘ and ‘}’. You might want to do something along the lines of…

st = st.replace("{","").replace("}","");

to get rid of the ‘{‘ and ‘}’.

1

solved How to convert String into String Array in Java? [duplicate]