Options
All
  • Public
  • Public/Protected
  • All
Menu

Module split

Index

References

Functions String

References

Renames and re-exports __type

String Functions

  • split(str?: string, separator?: string | RegExp, limit?: number): string[]
  • Splits string by separator.

    Note: This method is based on String#split.

    since

    5.0.0

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

    Parameters

    • Optional str: string

      The string to split.

    • Optional separator: string | RegExp

      The separator pattern to split by.

    • Optional limit: number

      The length to truncate results to.

    Returns string[]

    Returns the string segments.