[Solved] adding each line in a text file into a list c# [duplicate]
[ad_1] assuming you’ve already converted it to a string, you can use the string.split() function. This is using c#. sting yourtextfile; //make all the different sections the same yourtextfile.replace(“#main”, “#”); yourtextfile.replace(“#extra”, “#”); yourtextfile.replace(“!side”, “#”); //make all the arrays string[] all = yourtextfile.Split(‘#’); string[] main = all[0].Split(‘\n’); string[] extra = all[1].Split(‘\n’); string[] side = all[2].Split(‘\n’); Afterwards, … Read more