Splitting CString objects is mostly easy. But in some special cases, like handling CSV data, the following function can do a good job: it explains how to handle strings that contain the separator itself in the text.
The solution is to ‘escape’ all separators that occur in the text itself and use a splitting function that is aware of this [...]
Let’s build a scalable string concatenator, and then optimize its performance.
FastReplacer is good for executing many Replace operations on a large string when performance is important.
The main idea is to avoid modifying existing text or allocating new memory every time a string is replaced.
We have designed FastReplacer to help us on a project where we had to generate a large text with a large [...]
This is how CSV can be parsed when it is embedded in double quotes.Background
The article in based on RFC 4180, which states that the standard CSV may contain values separated by comma and embedded in double quotes.
Take a look at the RFC here: http://tools.ietf.org/html/rfc4180.The Code // Code /// <summary> /// RFC 4180 Comma Seperated Values /// [...]
As much as I use and appreciate the Standard C++ Library, I’ve never liked its string template – basic_string<>. At times, it seems the designers went out of their way to make it difficult to use.
On the other hand, I’ve always loved the ease of use of MFC’s [...]