TokenList (Class)
A base class for manipulating a comma-separated list of string values as a collection of items.
Any text or item added, updated, or inserted that contains commas will have separate items added to the item collection. Duplicate values may be added.
MyTokenList.Add("Symbol1"); // adds the first string value as item 0
MyTokenList.Add("Symbol2"); // adds the second string value as item 1
MyTokenList.Insert(0,"Symbol3"); // inserts a new string value at item 0
MyList=MyTokenList.Value; // MyList contains the comma-delimited string values "Symbol1,Symbol3,Symbol2"
RemoveAt(0); // deletes the first item in the list
MyString=Item[0]; // MyString will contain the string value for the first item which is now "Symbol3"
Note: It may be a good practice to force all text used with the TokenList to be either upper or lower case.
Namespace: tsdata.common
|
Name |
Description |
|
Add(name) |
Adds an item with the provided string value (name) to the list. |
|
Clear |
Removes all items from the list. |
|
Clone |
Creates a copy of the current instance. |
|
Contains(name) |
True if the list contains an item with the specified string value (name). |
|
Create |
Initializes a new instance of the class. |
|
Create(values) |
Initializes a new instance of the class using the specified comma-delimited list of values. |
|
IndexOf(name) |
Get the index of the list item with the specified string value (name). |
|
Insert(index,name) |
Inserts a string value (name) at the specified index position. |
|
Remove(name) |
Removes the first occurrence of a specified string value (name) from the list. |
|
RemoveAt(index) |
Removes a string value item from the list at a specified index position. |
|
ToString(string) |
Gets the full list of string values as a comma-delimited string. |
|
Name |
Description |
|
operator +=
|
Adds an string value item to the list. |
|
operator -= |
Removes the specified string value item from the list. |