Check out example codes for "unity read text file line by line". It will help you in understanding the concepts better.

Code Example 1

string path = "Path/names.txt";
     
         string[] lines = System.IO.File.ReadAllLines (path);
 
         c.name = lines[Random.Range(0,lines.Length)];

Learn ReactJs, React Native from akashmittal.com