Using gsub to strip multiple characters
Вопрос
I have an object which contains the following string "XXXXyyyy!!!!zzzz"
XXXX
- never the same, will always change, it may be a million characters long
yyyy
- will never change, exact number of characters all the time
!!!!
- this is the data I want to result with after I clean the string. This data will always change as well
zzzz
- will never change, exact number of characters all the time
so if:
string = "XXXXyyyy!!!!zzzz"
string.gsub("zzzz","")
# => "XXXXyyyy!!!!"
What can I do next to get just "!!!!"
. How can I use 'yyyy'
, which is static, to erase "XXXXyyyy"
and leave only "!!!!"
. I hope this explains my question. Sorry about the last one.
Нет правильного решения
Не связан с StackOverflow