I'm trying to write a script that reads from a text file using:
String letter= String.Format("%c", input.ReadRawChar());
I use: (letter.CompareTo(" ")==0) to check if the letter is a character or space but I run into problems when I reach a line break.
Can someone tell me what kind of check I should do for line breaks?
Thanks.
That seems pretty convoluted. Why not:
char letter=input.ReadRawChar();
if (letter==' ')... // space
if (letter==13 || letter==10) ... //CR or LF, i.e. end of line
I'm all for simplicity. I will give that a try.