A helper class for formatting strings.

Implements

Constructors

Accessors

Methods

  • Converts the value of objects to strings based on the formats specified and inserts them into another string.

    Parameters

    • formatOrOptions: string | FormatOptions

      The format string that acts as a template. The format string can contain one or more format items, which have this syntax: {index[:format]}. The index is the zero-based index of the argument whose string representation is to be included at this position in the string. The optional format is a format string that controls how the argument is converted into a string, if the argument is a Date object or number. To include a literal { or } character in the output, escape the character by repeating it twice in the format string. This argument can also be a format options object instead.

    • Rest...args: unknown[]

      The values to substitute into the format string. Null and undefined values will be converted into empty strings.

    Returns string