kaven-basic - v6.0.0
    Preparing search index...

    Function Format

    • Formats a string by replacing placeholders with corresponding arguments.

      Replaces each occurrence of {0}, {1}, {2}, etc., in the format string with the respective value from args.

      Parameters

      • format: string

        The string containing placeholders in the form {n} where n is a zero-based index.

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

        The values to replace the placeholders with. Each argument can be a string or number.

      Returns string

      The formatted string with all placeholders replaced by their corresponding arguments.

      Format("Hello, {0}!", "World"); // Returns "Hello, World!"
      Format("{0} + {0} = {1}", 2, 4); // Returns "2 + 2 = 4"

      4.0.0

      2021-12-14