954,514 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Comparing Strings in C#

Hi everyone!

I was wondering if anybody knew how to compare to strings in C#. I know in java you use CompareTo, but how and what do you use in C#?

Thanks,
C++ :mrgreen:

Ghost
Posting Whiz
352 posts since Aug 2004
Reputation Points: 12
Solved Threads: 2
 

I figured it out - the CompareTo method

Thanks :mad: :evil: :mad:

Ghost
Posting Whiz
352 posts since Aug 2004
Reputation Points: 12
Solved Threads: 2
 

Cool. Thread marked as solved.

cscgal
The Queen of DaniWeb
Administrator
19,424 posts since Feb 2002
Reputation Points: 1,474
Solved Threads: 230
 

I know this thread has been marked solved, but for anyone else wondering the same thing; you could also use the == operator. It's been overloaded in C#, so it works just fine ;)

Iron_Cross
Junior Poster
117 posts since Jul 2003
Reputation Points: 46
Solved Threads: 2
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You