mirror of
https://github.com/MartinKral/Slash-The-Hordes
synced 2025-01-13 14:31:34 +00:00
9 lines
254 B
TypeScript
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;
|
||
|
}
|