Function polyStrIncludes

  • The polyStrIncludes() method performs a case-sensitive search to determine whether one string may be found within another string, returning true or false as appropriate.

    Parameters

    • value: string

      The string value to be searched.

    • searchString: string

      A string to be searched for within the value. Cannot be a regex. All values that are not regexes are coerced to strings, so omitting it or passing undefined causes strIncludes() to search for the string "undefined", which is rarely what you want.

    • Optionalposition: number

      The position within the string at which to begin searching for searchString. (Defaults to 0.)

    Returns boolean

    true if the search string is found anywhere within the given string value, including when searchString is an empty string; otherwise, false.

    0.9.0

    TypeError If searchString is a regex.