This simplest way is to find all the spaces and / character and put individual word into a two-level list, you then get a structure like this:
- I
- have, had
- a lot, none, zero
- money
- .
Now you just loop thru the tree and generate a result string.
To push it to an overkill, you may also write a token parser instead of doing strchr.
How can i do this in the way, friendliest to cpu cycles ?
Why do you care?