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. 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 ...

  7. 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 …

  8. How to tell if a string contains a certain character in JavaScript?

    16 ES6 contains inbuilt method (includes) in String's prototype, which can be used to check if string contains another string or not.

  9. javascript - Search string for specific text - Stack Overflow

    Dec 26, 2018 · I'm trying to search a mixed string for specific text. at the moment, the following is only searching the start, and end of a string. I want to basically search for a word if it exists anywhere in …

  10. javascript - How do I search for a part of a string from a specific ...

    Nov 10, 2022 · use string.includes(searchString, position), that have a second param of position to start the search. position Optional The position within the string at which to begin searching for …