Solved

breaking strings in to sub strings  based on delimiters

Posted on 2009-04-06
5
195 Views
Last Modified: 2012-05-06
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".
0
Comment
Question by:sramya
  • 4
5 Comments
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 24084454
The built in functions (such as strtok) should be very fast.  I doubt you could code your own function that would be faster.
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 24084462
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
 

Author Comment

by:sramya
ID: 24084828
so you suggest that strtok is the best way to go...right?
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 24084943
yes
0
 
LVL 44

Accepted Solution

by:
AndyAinscow earned 250 total points
ID: 24084965
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

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
DLL Windows equivalent in MAC OS 8 113
need some help with Editbox 11 102
template declaration 35 134
c++ open source accounting software 3 85
The following diagram presents a diamond class hierarchy: As depicted, diamond inheritance denotes when two classes (e.g., CDerived1 and CDerived2), separately extending a common base class (e.g., CBase), are sub classed simultaneously by a fourt…
In Easy String Encryption Using CryptoAPI in C++ (http://www.experts-exchange.com/viewArticle.jsp?aid=1193) I described how to encrypt text and recommended that the encrypted text be stored as a series of hexadecimal digits -- because cyphertext may…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now