Created
December 6, 2010 19:46
-
-
Save lifeinafolder/730810 to your computer and use it in GitHub Desktop.
Character Search in String using !~ operators
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
var str = 'posterous'; | |
if ( !~str.search('t') ) { | |
// character 't' not found branch | |
} | |
else{ | |
// found branch | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment