split string with space in java code example
Example 1: space seperator in string in java
String[] splitted = "peter,james,thomas".split(",");
Example 2: hwo to split string by spaces in java
String lineOfCurrencies = "USD JPY AUD SGD HKD CAD CHF GBP EURO INR";
String[] currencies = lineOfCurrencies.split(" ");