I looked around, but couldn’t find what I was looking for….
Basically I have a string with lots of asterisks scattered around:
Example: red blue green * hello* pink orange 4pgp42g4jg42 * world* violet black
What I am trying to do is split the string up so I can extract “hello” and “world” and eventually print them out as a list using a for statement. The strings I’m working with are longer and do not necessarily have any set number of slices that I would want to take out.
Could anyone assist me with this please?
Thank you
Have you ever tried the
remodule? It uses a syntax called regular expression that allows you to do very complicated matches (see the docs here). In your case, you could try something like this: