Check out example codes for "string isnullorempty vs isnullorwhitespace". It will help you in understanding the concepts better.

Code Example 1

/* 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. */

Learn ReactJs, React Native from akashmittal.com