String Compare in c#.net

Posted by Selvarajmgp under C# on 5/17/2012 | Points: 10 | Views : 1359 | Status : [Member] | Replies : 1
Hi ,

Which one is the best for string compare in c#.net.

string.equal
string.compareto
string.compare .., etc

Advance Thanks,

Regards,

Selvaraju.n




Responses

Posted by: Sheonarayan on: 5/17/2012 [Administrator] HonoraryPlatinum | Points: 25

Up
0
Down
There are more functions than you have written and if your requirement is to just compare two strings to check for the equality then string.Equals is the way to go.

More on Comparing strings in C# - http://msdn.microsoft.com/en-us/library/fbh501kz(v=vs.80).aspx.

Thanks


Regards,
Sheo Narayan
http://www.dotnetfunda.com

Selvarajmgp, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response