About 50 results
Open links in new tab
  1. How to check whether a string contains a substring in JavaScript ...

    Nov 24, 2009 · Usually I would expect a String.contains() method, but there doesn't seem to be one. What is a reasonable way to check for this?

  2. substring - Javascript: find word in string - Stack Overflow

    Aug 25, 2014 · The JavaScript method determines whether a string contains the characters of a specified string. This method returns true if the string contains the characters, and false if not.

  3. javascript - Case-insensitive search - Stack Overflow

    I'm trying to get a case-insensitive search with two strings in JavaScript working. Normally it would be like this: var string="Stackoverflow is the BEST"; var result= string.search(/best/i); alert(

  4. javascript - Search for all instances of a string inside a string ...

    Jan 16, 2014 · 15 Hello I am using indexOf method to search if a string is present inside another string. But I want to get all the locations of where string is? Is there any method to get all the locations …

  5. javascript - What is the difference between indexOf () and search ...

    Dec 9, 2008 · The search function (one description here) takes a regular expression, which allows you to match against more sophisticated patters, case-insensitive strings, etc., while indexOf (one …

  6. regex - JavaScript: Search string from position - Stack Overflow

    Aug 1, 2022 · JavaScript has two useful methods, both which nearly do what I need. String.prototype.indexOf() will search for a substring and return its position. It has an optional …

  7. javascript - How to search for a string inside an array of strings ...

    After searching for an answer in other posts, I felt I have to ask this. I looked at How do I check if an array includes an object in JavaScript? and Best way to find if an item is in a JavaScript ...

  8. javascript - search () string for multiple occurrences - Stack Overflow

    Note that String.search method works with RegExp - if you supply a string then it will implicitly convert it into a RegExp. It more or less has the same purpose as RegExp.test, where you only want to know …

  9. How to check if a string contains text from an array of substrings in ...

    Apr 7, 2011 · Pretty straight forward. In javascript, I need to check if a string contains any substrings held in an array.

  10. Fastest way to search string in javascript - Stack Overflow

    Nov 28, 2013 · Fastest way to search string in javascript Asked 14 years, 8 months ago Modified 6 years, 3 months ago Viewed 13k times