Hi,
I have a problem with string comparison.
This is fine:
string i = "y";
if ( i == "y")
DoSomething();
But this doesn’t work:
string i = "y";
// Using StreamReader to read a line from a text file and the line is "n"
i = readline;
if ( i == "n") DoSomething();
( i == "n") <= returns false!!
But when I Debug.log(i), it shows “n” on the console correctly!
I figured out “n” declared in unity script and “n” read from external text file
had different HashCode.
But I couldn’t figure out how to solve this problem.
Help me, please?