Created
July 8, 2012 13:59
-
-
Save pparadis/3071037 to your computer and use it in GitHub Desktop.
String.IsNullOrEmpty javascript
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
String.IsNullOrEmpty = function(value) { | |
var isNullOrEmpty = true; | |
if (value) { | |
if (typeof (value) == 'string') { | |
if (value.length > 0) | |
isNullOrEmpty = false; | |
} | |
} | |
return isNullOrEmpty; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
if contains value equal 0 it passed true but that is not correct.