Function formatStr

Replaces placeholders in a string with corresponding values.

`formatStr("hello {1} world {0} foo {}", 1,2,3) // hello 2 world 1 foo 3`
  • Parameters

    • str: string

      The string containing placeholders.

    • Rest...args: (string | number | boolean)[]

      The values to replace the placeholders with.

    Returns string

    • The string with replaced placeholders.