Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "string/format/docs/types/index.d"

Index

Functions

Functions

Export assignment format

  • format(str: string, ...args: Array<any>): string
  • Inserts supplied variable values into a format string.

    throws

    invalid flags

    Parameters

    • str: string

      input string

    • Rest ...args: Array<any>

    Returns string

    formatted string

    Example

    var str = format( 'Hello %s!', 'world' );
    // returns 'Hello world!'

    Example

    var str = format( 'Pi: ~%.2f', 3.141592653589793 );
    // returns 'Pi: ~3.14'