breaking strings in to sub strings based on delimiters

Can any one suggest the best of breaking strings in to sub strings  based on delimiters?
is strtok is best way or is there any thing else whihc can do teh operation faster. i need to break a very long strings up to 100000 char long so need a very efficient way of it breaking it on "\n\r".
sramyaAsked:
Who is Participating?
 
AndyAinscowConnect With a Mentor Freelance programmer / ConsultantCommented:
Well, to be more accurate
If, for example, there would be a gap of at least 1000 chars between each token to split the string on then maybe you could get something fractionally faster (especially if you wrote some machine level code)
0
 
AndyAinscowFreelance programmer / ConsultantCommented:
The built in functions (such as strtok) should be very fast.  I doubt you could code your own function that would be faster.
0
 
AndyAinscowFreelance programmer / ConsultantCommented:
Don't forget - basic functions like that are used by the operating system and other low level code, a lot of time has gone into optimising their performance.
0
 
sramyaAuthor Commented:
so you suggest that strtok is the best way to go...right?
0
 
AndyAinscowFreelance programmer / ConsultantCommented:
yes
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.