TWideStrings:Delphi Widestring Lists
This TWideStrings implementation has one limitation - it uses the WideFormat function which cannot handle widestrings with more than 4096 characters. Replace it with XWideFormat for increased functionality. Individual widestrings in TWideStrings must be less than MAXWORD characters long. TWideStrings has three properties
- StringCount: Integer - The number of entries in the list.
- Strings[Index: Integer] :WideString - The array of widestring values stored in the list. This is the default property.
- Text: WideString - A string containing all the entries in the list. Individual entries are separated using the widechar #$E000 in the Unicode PUA.
The principal methods of TWideStrings are listed below
- constructor CreateEx - This is the object constructor. Internally, it creates an instance of TList used to store string values.
- function Add(const Value: WideString ) :Integer - Adds the specified widestring value to the list. Returns the number of entries in the list after addition
- procedure ClearEx - Empties the list.
- function IndexOf(const Value: WideString ) :Integer - Returns the index of the first occurrence of Value in the list. Returns -1 if Value does not occur in the list.
- procedure Remove( Index: Integer ) - Deletes the entry at Index. Removes the entry at the specified Index. Does nothing if Index is invalid.
Usage: Create an instance of TWideStrings whenever you need to store a sequence of related Unicode strings. Use TWideString methods and properties to manage your entries. Remember to free the instance once you are done.
Download