function replaceAll(input: string, searchValue: string, replaceValue: string): string { const regex = new RegExp(searchValue, 'g'); return input.replace(regex, replaceValue); } // Example Usage // let text: string = "hello world, hello!"; // text = replaceAll(text, "hello", "hi"); // console.log(text); // "hi world, hi!" export default replaceAll