NewDash

    Function split

    • Splits string by separator.

      Note: This method is based on String#split.

      Parameters

      • Optionalstr: string

        The string to split.

      • Optionalseparator: string | RegExp

        The separator pattern to split by.

      • Optionallimit: number

        The length to truncate results to.

      Returns string[]

      Returns the string segments.

      5.0.0

      split('a-b-c', '-', 2)
      // => ['a', 'b']
    MMNEPVFCICPMFPCPTTAAATR