Asieh Asieh - 1 year ago 145
C# Question

Difference between IsNullOrEmpty and IsNullOrWhiteSpace in c#

what Difference between this commands in c#

string text= " ";


Answer Source

IsNullOrWhiteSpace is a convenience method that is similar to the following code, except that it offers superior performance:

return String.IsNullOrEmpty(value) || value.Trim().Length == 0;

White-space characters are defined by the Unicode standard. The IsNullOrWhiteSpace method interprets any character that returns a value of true when it is passed to the Char.IsWhiteSpace method as a white-space character.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download