As per the question, is there a better/more robust way of checking if a String contains a newline from any platform in Java, or is below the recommended approach?
if (myString.contains("\n") || myString.contains("\r") || myString.contains("\r\n")) {
}