Line Counter
How This Converter Works
Counts lines split by CRLF, CR, or LF. Empty input is specially reported as zero; a trailing line break creates a final counted empty line.
Formula or rule
For non-empty input, line count = input.split(/\r\n|\r|\n/).length.
Example
- Input
- red
blue - Calculation
- The LF separates the input into two segments.
- Result
- 2