Documentation
    Preparing search index...

    Function split

    • Split a string into substrings using the specified separator and return them as an array.

      Parameters

      • str: string

        the string to split.

      • delimiter: string | RegExp | CustomStringSplitDelimiter

        a string or Regular Expression that separates the str into substrings.

      • Optionallimit: number

        limit the number of elements returned in the array.

      Returns string[]

      • Unlike JS built-in String.split method, if the separated substring count were to exceed the limit, the last item will contain the rest of the string.
      • Like the built-in method, if delimiter is empty string, this function will return an array of UTF-16 characters of str. If delimiter is a Regular Expression and it matches empty string, the corresponding array item will be the next UTF-16 character (without u flag) or Unicode code point (with u flag) from the current matching position of str.
    • Split a string into substrings using the specified separator and return them as an array.

      Parameters

      Returns string[]

      • Unlike JS built-in String.split method, if the separated substring count were to exceed the limit, the last item will contain the rest of the string.
      • Like the built-in method, if delimiter is empty string, this function will return an array of UTF-16 characters of str. If delimiter is a Regular Expression and it matches empty string, the corresponding array item will be the next UTF-16 character (without u flag) or Unicode code point (with u flag) from the current matching position of str.