Created
December 3, 2015 15:33
-
-
Save manojrammurthy/3946b1911b96521f4b99 to your computer and use it in GitHub Desktop.
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
| //to check if a string ends with the specific target | |
| function end(str, target) { | |
| // "Never give up and good luck will find you." | |
| // -- Falcor | |
| if(str.substring((str.length-target.length),(str.length))==target){ | |
| return true; | |
| } | |
| else{ | |
| return false; | |
| } | |
| } | |
| end("He has to give me a new name", "name"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment