lineCount

Returns the lines count within the input range. The input range is not consumed.

size_t
lineCount
(
Range
)
(
Range range
)

Examples

1 auto text1= "";
2 assert(text1.lineCount == 0);
3 auto text2 = "\n\r\n";
4 assert(text2.lineCount == 2);
5 auto text3 = "0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n\n\n";
6 assert(text3.lineCount == 12);

Meta