mirror of
https://github.com/MartinKral/Slash-The-Hordes
synced 2024-12-26 11:48:54 +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;
|
||
|
}
|