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