How do I replace all instances where I have #sometext# in order of the array provided?
The text is a string and my goal is to search for all instances where I have some text surrounded by the "#" character. Then replace those instances with values in the array in the order of the array
Example:
const text = "You are the #RANKED# highest ranked user (out of #TOTALUSER# people)"
const myArray = [10, 50];
After searching and replacing the text should be:
"You are the 10 highest ranked user (out of 50 people)"