how to split string in java across lines r code example Example: split by new line java String lines[] = string.split("\\r?\\n");