A Multiple Substring Search Class: CIVStringSet
There are probably dozens of reasons a programmer might want to search a text string for the presence of any of several substrings simultaneously. The brute force approach taken all too often is to simply loop through a list of tokens, then search the string sequentially, beginning to end, for each one. Needless to say, this is very inefficient, and can even become outrageously long if the list of tokens is long and/or the searched string is long. I have created a class to simplify the task and perform it very efficiently. The class is offered in two versions now: one using MFC CString and CStringArray, and another using STL std::string and std::vector.
http://www.codeproject.com/string/civstringset.asp
http://www.codeproject.com/string/civstringset.asp
0 Comments:
Post a Comment
<< Home