Function words

  • Split a string into an array of its words.

    Returns

    Returns the words array.

    Example

    words('lord of the rings')
    // ['lord', 'of', 'the', 'rings']

    Parameters

    • s: string

      The string to split

    • Optional pattern: string | RegExp

      The pattern to match words

    Returns string[]

Generated using TypeDoc