Hello everyone.
I’m creating a custom class to parse my own level files. To make it, I’m treating the text file string as an array of char, calling string to get a char from the array. Although it’s working mostly fine I’m having problems into detecting new lines, as I can’t tell wether the char I’m reading is a new line character or not. I was trying to do:
if(string_file != System.Environment.NewLine) {
//Some code here
}
The problem is System.Environment.NewLine is a String, and I can’t seem to get to treat it like a single character. I’ve already tried to check with System.Environment.NewLine[0] as well but I’m not getting the desired results. I might be missing something here, any help would be much appreciated.
Thank you very much