How to split a string with a delimiter larger than one single char?
- by Nazgulled
Hi,
Supposing I have this:
"foo bar 1 and foo bar 2"
How can I split it into:
foo bar 1
foo bar 2
?
I tried strtok() and strsep() but neither worked. They don't recognize "and" as delimiter, they recognize "a", "n" and "d" as delimiters.
Any function to help me with this or I'll have to split by the blank space and do some string manipulation?