The StringSet object is container that stores one or more unique strings. It is similar to an array or vector (e.g. Vector) but has the advantage of using a dictionary system to locate strings rather than numeric indexes. You can therefore lookup strings much more quickly than by linearly searching a Vector.
You can create a new StringSet using the DOpusFactory object. A StringSet can be either case-sensitive ("cat" and "CAT" would be treated as two different strings) or case-insensitive.
Method Name | Arguments | Return Type | Description |
---|---|---|---|
<StringSet:from> |
none |
Copies the contents of another StringSet to this one. You can also pass an array of strings or Vector object. |
|
none |
none |
Clears the contents of the StringSet. |
|
<string> |
none |
Erases the string if it exists in the set. |
|
<string> |
bool |
Returns True if the specified string exists in the set. |
|
<string> |
bool |
Inserts the string into the set if it doesn't already exist. Returns True if successful. |
|
<StringSet:from> |
none |
Merges the contents of another StringSet with this one. |