Skip to content

Instantly share code, notes, and snippets.

@ultim8k
Last active August 29, 2015 14:01
Show Gist options
  • Save ultim8k/e874fb23c877cf6d34a0 to your computer and use it in GitHub Desktop.
Save ultim8k/e874fb23c877cf6d34a0 to your computer and use it in GitHub Desktop.
Some methods to use with strings
/**
* Javasting :)
*/
var start_with_space = function (string) {
return /^\s+\S+\s*$/.test(string)
}
var is_blank = function(string) {
return /^\s*$/.test(string)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment