Counts the number of lines in a string.
The input string.
Number of lines in the string.
\n
\r\n
\r
countLines("a\nb\nc"); // 3countLines("a\r\nb\r\nc"); // 3countLines("hello"); // 1 Copy
countLines("a\nb\nc"); // 3countLines("a\r\nb\r\nc"); // 3countLines("hello"); // 1
Counts the number of lines in a string.