G
Guest
I'm trying to convert this VB.net function to C#:
Public Overridable Function nbhdValidate() As Boolean
If ((strFrom <> "") Or (strTo <> "")) Then
Return False
Else
Return True
End If
End Function
This is what I'm trying:
public bool nbhdValidate(bool bVal)
{
if (strFrom = "" | strTo = "")
return false;
else
return true;
}
This is the error: Operator | cannot be applied to operands of type string:
Please advise.
Public Overridable Function nbhdValidate() As Boolean
If ((strFrom <> "") Or (strTo <> "")) Then
Return False
Else
Return True
End If
End Function
This is what I'm trying:
public bool nbhdValidate(bool bVal)
{
if (strFrom = "" | strTo = "")
return false;
else
return true;
}
This is the error: Operator | cannot be applied to operands of type string:
Please advise.