Say I have a simple list such as "apples, bananasx2, orangesx3, pears."
Is there a function that will convert this into "apples, bananas, bananas, oranges, oranges, oranges, pears"?
I've tried to write an if loop but I can't figure out how to identify the number and also repeat the string by that number. This info is currently in dataframe columns but it doesn't have to be.