Options
All
  • Public
  • Public/Protected
  • All
Menu

Module string/words

Index

References

Functions String

References

Renames and re-exports words

String Functions

  • words(string?: string, pattern?: string | RegExp): any
  • Splits string into an array of its words.

    example

    words('fred, barney, & pebbles') // => ['fred', 'barney', 'pebbles']

    words('fred, barney, & pebbles', /[^, ]+/g) // => ['fred', 'barney', '&', 'pebbles']

    Parameters

    • string: string = ''
    • Optional pattern: string | RegExp

    Returns any

    Returns the words of string.

Generated using TypeDoc