This is the first "full" release of this class. You've probably sometimes heard of StringBuilder classes or about cString class that offer a better performance for concatenating strings. This class does this, but it does it much better than other classes of this kind, being both easy to use and fast. Besides concatenation there are many more features included within this class.
Sample syntaxes:This isn't a final release of the class: there is room for new features and for further optimizations, although at this point of performance the latter isn't just as important.Code:Dim strTemp As New clsBSTR strTemp = "Hello!" MsgBox strTemp ' output: the obvious MsgBox strTemp.SetValue("this line has LOTS OF STUFF!").PCase ' output: "This Line Has Lots Of Stuff!" MsgBox strTemp.SetValue("One?").Replicate(5) ' output: "One?One?One?One?One?" strTemp = "AAABCCC" strTemp.Middle(0, 3) = "_" strTemp.Middle(strTemp.Length - 3, 3) = "_" MsgBox strTemp ' output: "_B_" strTemp = "ABC" strTemp.Middle(2, 0) = "[surprise!]" strTemp.Middle(1, 0) = "[a big]" MsgBox strTemp ' output: "A[a big]B[surprise!]C" strTemp = "1|2|3|2|1|4|5|6|9|8|7|8|9" MsgBox strTemp.Trim "123789|" ' output: "4|5|6"
This thread is open for feature requests and generic feedback. If you wish to talk about the optimization tricks or you have ideas on what could be done better, check the thread over at Code It Better forum.




Reply With Quote