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