Created
January 16, 2018 12:34
-
-
Save KanshuYokoo/b63f0432dc05c117bd5e9f004e60cee1 to your computer and use it in GitHub Desktop.
how to know if the string contains another string in JS.
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
RegExp(anotherString).test(yourStringContainsStrings) |
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
yourStringContainsSomeString.indexOf(anotherString) > 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment