posted 12 years ago
I'm pretty sure the answer would be obvious if you printed out "str" and "s" just before your If statement.
It's a pretty standard debugging technique: When your if statement isn't giving you what you expect, check to make sure you are REALLY comparing what you think you are.
In this case, you are not.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors