Is there a base function or simple way to replace multiple strings with multiple strings in a reference String?
I have seen Replace multiple strings with multiple other strings but it is using known lists instead of variable ones.
For example:
I have val str = "THE GOAT IS RED"
, and I want to replace all the characters with other characters or digits, something like:
str.replace("THEGOAISRD".toList(), "0123456789".toList())
To which will result
"012 3450 67 829"