if (string = string) error converting string to bool

I'm from a vb.net back ground and not sure how to compaire two string values in a if statement.
I know that in c# that if statements always return a boolen value and thats fine but i just want to make sure two string have the save value.
j_tippsAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rodney HelsensCommented:
are you using the double == for comparison

if (string == string)

not

if (string = string), which is assignment..
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
j_tippsAuthor Commented:
oo crap that was it, thanks man
0
dcgamesCommented:
in C#? Remember strings are objects. You can type:

    if( myStr1.Equals( myStr2 ) ) { ... }

Which I believe is exactly the same

    if( myStr1 == myStr2 ) { ... }

but clear in the sense that you are asking the myStr1 object to tell you whether myStr2 represents the same object.

This works for any object, not just strings.

Dave
0
j_tippsAuthor Commented:
ya thansk for the 411 Dave!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.