Overview
|
Next |
This library provides enhanced string handling for Basic4PPC and will run under .Net 1.0 and 2.0 on both device and desktop. There are two objects, StringsEx and StringBuilder, included in this library. This help file documents version1.1 of the library.
StringsEx provides some additional string manipulation functions. As with all Basic4PPC (.NET) strings the original string is not altered but a new string containing the required contents is returned. Some of the methods provided can already be synthesised using existing Basic4PPC String handling, such as EndsWith, but are more efficiently implemented here. Also the explicit titling of such methods can make the intentions of code clearer.
StringBuilder provides a high performance way to concatenate many strings. As stated above .NET strings are not "mutable" so concatenating (appending) two strings needs memory to be allocated for a third string and the two strings copied into the memory. This is inefficient when concatenating many (say more than ten) strings so for this reason the StringBuilder is available. A StringBuilder is a "mutable" string. It allocates memory once and copies the content of strings to be appended to this memory so saving memory allocation and multiple copies of earlier appended string data to a new string. Also a StringBuilder can grow itself if its' initial capacity is not enough.
A. Graham (c) 2008