provided by: 
Originally published at Internet.comThe XString-class is a powerfull extension to the standard CString-class. Whereever you use a CString you can now use a XString with much more functionality. The class includes many string-functions I missed in CString, like removing, replacing or inserting strings into another, convertingfunctions to double or int and case-insensitive find, replace and remove. But the most powerfull extension is a method I called 'Elementstrings'. Most of the functions are const and return a XString, so you can use them in an expression. The functionality of this class is not very difficult to understand or to implement, but in my case, it saves a lot of time in my projects.
If you miss some functions which could be usefull to extend this class please contact me.
Additional String functions
What are Elementstrings?
Elementstring functions
Friend functions Download source file (8 KB) (comments in german)
Additional Stringfunctions:
Function Description Example Result XString num("12.345"); Double Convertion to double num.Double() 12.345 Int Convertion to int num.Int() 12 Char Convertion to char num.Char() 1 Bool Convertion to bool num.Bool() true XString test("Test Test"); Remove Remove first occurence of a string, char or range test.Remove('e') "Tst Test" RemoveAll Remove all occurences of a string or char test.RemoveAll("e") "Tst Tst" Replace Replace first occurence of a string, char or range with another string test.Replace("x", "e") "Txst Test" ReplaceAll Replace all occurences of a string or char with another string test.ReplaceAll("x", "e") "Txst Txst" Insert Inserts a string at a given position test.Insert("e", 1) "Teest Test" XString op("Test");...
Read article at Internet.com site