Obviously all of those work, if you know the string you want to compare thing to, you don't need to create a variable just to compare (I'm pretty sure, the program I made today seems to work, so I suspect this is right).
eg:
Code:
string input = HeresSomethingIPreparedEarlier();
if (input.ToLower() == "cake")
return "pie";
I suspect some of those other functions are there so Java programmers feel more comfortable (eg: in Java you have to use .equals() when comparing a variable string (eg string cake = "pie") to a constant (eg: "pie").
Bookmarks
Algorithms and Data Structures
Java tutorials
Algorithms Forum