Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save KanshuYokoo/b63f0432dc05c117bd5e9f004e60cee1 to your computer and use it in GitHub Desktop.
Save KanshuYokoo/b63f0432dc05c117bd5e9f004e60cee1 to your computer and use it in GitHub Desktop.
how to know if the string contains another string in JS.
RegExp(anotherString).test(yourStringContainsStrings)
yourStringContainsSomeString.indexOf(anotherString) > 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment