splits any given String into an array of substrings java code example Example: split string into array java String[] array = values.split("\\|", -1);