Also, a more general solution would be to handle different types of newlines:
int len = System.Text.RegularExpressions.Regex.Split("line1\r\nline2", @"\r?\n").Length;
Alternatively, you could use another version of string.Split:
int len = "line1\r\nline2".Split(new string[] { "\r\n", "\n" }, StringSplitOptions.None).Length;