Thanks Jon, and I have been looking for a tutorial to tell me this for
hours, but any that I found only had one expression in the if statement,
which is why I resorted to this newsgroup.
It doesn't really help when I type in something like 'vbCrLf' in the VS.NET
search pane to find out what this would be in C# (which I still don't know
by the way, so please tell me), and it comes back with 500 articles called
'ASP Technology and the XML DOM', or 'Create and Update a Scheduled Content
Download', both of which have nothing to do with my query, both articles
don't even have the literal string 'vbCrLf' in them.
"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
Daniel Rimmelzwaan <ri*********@xhotmail.com> wrote: I have a conditional statement in VB that I want to translate in C#, but
I can't find the syntax.
VB:
If (MyFirstString = "" or MySecondString = "") Then
<insert your code here>
End if
C#
if (MyFirstString == "" ---- then what?) I can't get rid of those red
squiggly lines if I use "or"
{
<insert your code here>
}
the keyword "or" does not seem to exist in C#, or I am not typing it
correctly. Can anyone please show me how to do this?
Indeed, the keyword "or" doesn't exist. You want to use ||. I suggest
you read the section in MSDN about the C# operators - or read a
tutorial on the web.
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too