I have he following issue:
String line = @"Line1
            Line2
            Line3
            Line4";
I am trying to create a loop that detects when the carriage return character is encountered and store each row on a separate string.
String value    
static long LinesCount(string s)
        {
        long count = 0;
        int position = 0;
        while ((position = s.IndexOf('\n', position)) != -1)
            {
            count++;           
            }
        return count;
        }
for (int i = 1; i > LinesCount(line); i++)
        {
            value = line.Split(Environment.NewLine)
        }
 
     
    