Function findSubstringIndexes

  • Finds all indexes of a searchFor string or RegExp in searchIn. Ths is similar to ''.indexOf except that it finds all indexes of.

    Type Parameters

    • IncludeLength extends undefined | boolean

    Parameters

    • __namedParameters: {
          caseSensitive: boolean;
          includeLength?: IncludeLength;
          searchFor: string | RegExp;
          searchIn: string;
      }
      • caseSensitive: boolean
      • OptionalincludeLength?: IncludeLength

        Set to true to get an array of objects with the found indexes and their lengths.

      • searchFor: string | RegExp
      • searchIn: string

    Returns IncludeLength extends true ? { index: number; length: number }[] : number[]