Check out example codes for "for each line in string c#". It will help you in understanding the concepts better.

Code Example 1

using (var reader = new StringReader(multiLineString))
{
    for (string line = reader.ReadLine(); line != null; line = reader.ReadLine())
    {
        // Do something with the line
    }
}

Learn ReactJs, React Native from akashmittal.com