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

[ad_1]

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

[ad_2]

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