Slash-The-Hordes/assets/Scripts/Services/Utils/StringUtils.ts

9 lines
254 B
TypeScript
Raw Permalink Normal View History

2022-12-16 12:52:54 +00:00
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;
}