Counting lines in a string





5.00/5 (7 votes)
Can't we have something as below?int n=(s.Split(new char[]{'\n'})).Length;where n is the number of lines?
Can't we have something as below?
int n=(s.Split(new char[]{'\n'})).Length;
where n is the number of lines?