@tspro/ts-utils-lib
    Preparing search index...

    Function splitByStrings

    • Splits a string by any of the given substrings. Each splitter is treated literally (special regex characters are escaped).

      Example:

      splitByStrings("one--two__three", "--", "__");
      // ["one", "two", "three"]

      Parameters

      • str: string

        The input string to split.

      • ...splitters: string[]

        One or more substrings to split by.

      Returns string[]

      An array of string segments split at any of the given substrings.