Slash-The-Hordes/assets/Scripts/Services/Utils/StringUtils.ts
2022-12-16 13:52:54 +01:00

9 lines
254 B
TypeScript

export function formatString(text: string, params: string[]): string {
let textWithParams = text;
for (let i = 0; i < params.length; i++) {
textWithParams = textWithParams.replace(`{${i}}`, params[i]);
}
return textWithParams;
}