String.format method
String › format
Official
Formats a string using the indexed placeholders.Signature:
format(args?: string[]): stringParameters:
| Parameter | Type | Description |
|---|---|---|
| args? | string[] | The arguments to format the string with. |
Returns: string — The formatted string.
Example:
console.log('foo {0} bar {1} baz {0}'.format('qux', 'quux')); // foo qux bar quux baz qux