Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "string/remove-words/docs/types/index.d"

Index

Functions

Functions

Export assignment removeWords

  • removeWords(str: string, words: Array<string>, ignoreCase?: undefined | false | true): string
  • Removes a list of words from a string.

    Parameters

    • str: string

      input string

    • words: Array<string>

      array of words to be removed

    • Optional ignoreCase: undefined | false | true

      boolean indicating whether to perform a case-insensitive operation (default: false)

    Returns string

    output string

    Example

    var str = 'beep boop Foo bar';
    var out = removeWords( str, [ 'boop', 'foo' ] );
    // returns 'beep  Foo bar'

    Example

    var str = 'beep boop Foo bar';
    var out = removeWords( str, [ 'boop', 'foo' ], true );
    // returns 'beep   bar'