Created
March 14, 2014 17:11
-
-
Save EdCharbeneau/9552248 to your computer and use it in GitHub Desktop.
Javascript test a string to see if it is Null or Whitespace. Equivelent to C# String.IsNullOrWhiteSpace
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isNullOrWhiteSpace(str) { | |
return (!str || str.length === 0 || /^\s*$/.test(str)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
if i have
@Html.EditorFor(m=>m. name) @Html.EditorFor(m=>m. lastname) how i defind that name is empty