java string split by length to array code example Example: split string into array java String[] array = values.split("\\|", -1);