Ok, so what I need to do is split a string. Here is an example string that I need to split:
test_french_fries
and let's say I want to split the string into two parts, the part before and after:
french
thus I would get a return of something like:
match[1]=[test_]
match[2]=[_fries]
I have tried messing around with strtok()
but I have had no success with that. It appears that strtok()
splits the string at all delims that are given - so if I were to give it a delim of french
, it would separate the string for each character matched - which ISN'T what I want.
I would like to have a delim where I can provide it a str or char* such as "french" and the string be split before and after the string provided.
Are there any other methods besides strtok()
that I could possibly try to implement in order to achieve my desired outcome?
I really appreciate any and all help that I receive.
-Patrick