Check out example codes for "how to read a text file C#". It will help you in understanding the concepts better.

Code Example 1

// To save the text as one string use 'ReadAllText()'
string text = System.IO.File.ReadAllText(@"C:\filepath\file.txt");
// To save each line seperately in an array use 'ReadAllLines()'
string[] lines = System.IO.File.ReadAllLines(@"C:\filepath\file.txt");

Code Example 2

using (StreamReader streamReader = new StreamReader(path_name, Encoding.UTF8))
  contents = streamReader.ReadToEnd();

Code Example 3

string[] text = System.IO.File.ReadAllLines(@"C:\users\username\filepath\file.txt");

Learn ReactJs, React Native from