Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "string/substring-after/docs/types/index.d"

Index

Functions

Functions

Export assignment substringAfter

  • substringAfter(str: string, search: string, fromIndex?: undefined | number): string
  • Returns the part of a string after a specified substring.

    Parameters

    • str: string

      input string

    • search: string

      search string

    • Optional fromIndex: undefined | number

      index at which to start the search (default: 0)

    Returns string

    substring

    Example

    var out = substringAfter( 'Hello, world!', ', ' );
    // returns 'world!'

    Example

    var out = substringAfter( 'beep boop', 'beep' );
    // returns ' boop'

    Example

    var out = substringAfter( 'beep boop', 'boop' );
    // returns ''

    Example

    var out = substringAfter( 'beep boop', 'xyz' );
    // returns ''

    Example

    var out = substringAfter( 'beep boop', 'beep', 5 );
    // returns ''

    Example

    var out = substringAfter( 'beep boop beep baz', 'beep', 5 );
    // returns ' baz'