UNPKG

@genexus/web-standard-functions

Version:

GeneXus JavaScript standard functions library for web generators

15 lines 470 B
import { rTrim } from "./rTrim"; /** * Formats a string by replacing the placeholders with the specified parameters * @param {string} str The format string * @param {any[]} args The replacement strings * @return string */ export const format = (str, ...args) => { let result = str; for (let i = 0; i < args.length; i++) { result = result.replace(`%${i + 1}`, rTrim(args[i].toString())); } return result; }; //# sourceMappingURL=format.js.map