Set String Array or List to .txt File in a Builds Data Folder

Hello! After building a game if I go into the data folder for the game and create a .txt file, in this case we’ll call it “strings,” how could I access that .txt file in a C# script, and set each line in that .txt file to a string element in an array or list? I only need to read from the .txt file, not write to it. Thank you!

Well just use those two lines:

string filename = System.IO.Path.Combine(Application.dataPath, "strings.txt");
string[] lines = System.IO.File.ReadAllLines(filename);

if you want a list instead of course you can simply do

List<string> lines = new List<string>(System.IO.File.ReadAllLines(filename));

Thanks! It worked perfectly, I didn’t know there was a Application.dataPath, so thank you for teaching me that! (EDIT: Gave you a reputation point, it’s my first time doing that so I hope it worked! Thank you so much again!)