Comparing a string to an array extraction?

Hoping someone can assist as I’m pulling my hair out. I’ve got an array that is pulling its lines from a text document where each line of text is an array entry, works no issue.

However I’m trying to compare a line from the array as text but it doesn’t seem to be working.

string lineToCheck = textLines[currentLine];
print (lineToCheck);

if(lineToCheck=="thing"){
	print ("well it worked I guess?");
}

lineToCheck is definitely appearing as thing but when compared just isn’t picking up that it should be matching. Can someone point out where I’m going wrong?

I’ve also tried utilizing ToString but no dice.

I have looked around the net before resorting to bothering the community but I really just cannot figure out where my hiccup is.

My guess is there’s a hidden character, like a newline, from when it was read in. You can use print(lineToCheck + "~" + lineToCheck.Length); to see how long the saved string is, and if there is a newline in there it’d show up in the console with “~6” below “thing”.

You can remove special characters like that with:

lineToCheck = lineToCheck.Replace("

“,”");