how to split a string to string array using whitespace in java code example Example: space seperator in string in java String[] splitted = "peter,james,thomas".split(",");