Skip to main content

format (variable substitution in string)

Format returns a formatted string using the specified format string and arguments.

format(formatString, ...args)

Parameters#

  • formatString: A string having %s format specifiers.
  • args: Arguments referenced by the format specifiers in the format string.

Returns#

  • A formatted string

Examples#

print(format('This car was made in %s. Now it values %s', 1990, '$20000'))