Created
August 18, 2014 01:51
-
-
Save Alex1990/cbfe807ce9564bc6444e to your computer and use it in GitHub Desktop.
check if a string is blank (may contain white-space)
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
/* | |
* Ref: http://stackoverflow.com/questions/154059/how-do-you-check-for-an-empty-string-in-javascript | |
*/ | |
function isBlank(str) { | |
return !str || !/\S/.test(str); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment