[Solved] How can I split a string by a delimiter in Java? [duplicate]

[ad_1]

You can use the function split:

String[] words = yourString.split(" ");
int currency = Integer.parseInt(words[0]);
String currencyFrom = words[1];
String currencyTo = words[2];

1

[ad_2]

solved How can I split a string by a delimiter in Java? [duplicate]