Monday, 26 August 2013

Does string.IsNullOrEmpty have performance issues?

Does string.IsNullOrEmpty have performance issues?

Is there any difference between this two ways of checking the string?
if(!string.IsNullOrEmpty(myString))
{
//Do something
}
and
if(!myString != null && !myString != "")
{
//Do something
}
So far I though no, but someone is saying so. And he's saying that the
second one is better as the first one requires a method call.
I'm a little confused.

No comments:

Post a Comment