split a string after every linebreak code example Example: split by new line java String lines[] = string.split("\\r?\\n");