question 1
i need to remove strings of characters from my strings and replace them with one character. for instance, if my string is
"this AAAAA is a test 222222".
i want this to become
"this A is a test 2".
how can i do this?
question 2
can i make the same for strings? for example,
"this this this is a test"
i want it to become
"this is a test"
question 3
can i make this generic, without specifying what string i want to remove duplication for? for example, in the question 2 above, i might have to specify that the string i want to remove duplication for is "this" (so that "this this this" becomes "this"). but can i make a function which will take a string, and remove any duplicate substrings?
thanks/erick