Created
March 21, 2014 19:10
-
-
Save rvbsanjose/9693709 to your computer and use it in GitHub Desktop.
Simple Symbols
This file contains hidden or 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 SimpleSymbols(str) { | |
| if ( str.length == 0 || !str.match(/[a-zA-Z]/) ) | |
| return false; | |
| for ( var i = 0; i < str.length; i++ ) { | |
| if ( str[i].match(/[a-zA-Z]/) ) { | |
| var v = [str[i-1] == '+', str[i+1] == '+'].every(function (e, idx, ary) { | |
| return ( e == true ); | |
| }); | |
| if ( v == false ) | |
| return false; | |
| } | |
| } | |
| return v; | |
| } | |
| // keep this function call here | |
| // to see how to enter arguments in JavaScript scroll down | |
| SimpleSymbols(readline()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment