mirror of
https://github.com/MartinKral/Slash-The-Hordes
synced 2024-12-25 19:28:53 +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;
|
|
}
|