Simplified newline check in strings.