I need to read from a text file and add the lines to an array, however, there is one problem. when I open the text file in notepad everything looks good
1
2
3
but if I open using notepad++, textpad, or any other text editor or even doing copy paste it will look like this
1
2
3
4
Here is the code:
using (var reader = new StreamReader(@"C:\Users\username\Desktop\Example\text1.txt".Replace("username", Environment.UserName)))
{
// Read the User Regex Format and add it to List
string[] temp = reader.ReadToEnd().Split('\n');
foreach (string s in temp)
RegexFormat.Add(s);
}