c# If textbox1.text = textbox2.text erk!!!

ARG!!! Bloody c# and it's odd functions... I remember the days in VB when you could do

[code]
If textbox1.text = textbox2.text then
 'do some funny things
else
 'do something else
end if
[/code]

But you can't in C#... any one got any ideas?

Cheers,
LVL 1
reclusiveAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
drichardsConnect With a Mentor Commented:
C# syntax is more like Java/C++ than VB:

if ( textBox1.Text.Equals(textBox2.Text) )
{
   // do stuff
}
else
{
   // other stuff
}

or


if ( textBox1.Text == textBox2.Text )
{
   // do stuff
}
else
{
   // other stuff
}
0
All Courses

From novice to tech pro — start learning today.