# StringSet

The **StringSet** object is container that stores one or more unique strings. It is similar to an array or vector (e.g. [**Vector**](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**](vector).

You can create a new **StringSet** using the \*\*[DOpusFactory](dopusfactory)\*\*object. A **StringSet** can be either case-sensitive ("cat" and "CAT" would be treated as two different strings) or case-insensitive.

| Property Name | Return Type | Description                                                       |
| ------------- | ----------- | ----------------------------------------------------------------- |
| count         | _int_       | Returns the number of elements the **StringSet** currently holds. |
| empty         | _bool_      | Returns **True** if the **StringSet** is empty, **False** if not. |
| length        | _int_       | A synonym for **count**.                                          |
| size          | _int_       | A synonym for **count**.                                          |

| Method Name | **Arguments**        | Return Type | Description                                                                                                                     |
| ----------- | -------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------- |
| assign      | <**StringSet**:from> | _none_      | Copies the contents of another **StringSet** to this one. You can also pass an array of strings or [**Vector**](vector) object. |
| clear       | _none_               | _none_      | Clears the contents of the **StringSet**.                                                                                       |
| erase       | \<string>            | _none_      | Erases the string if it exists in the set.                                                                                      |
| exists      | \<string>            | _bool_      | Returns **True** if the specified string exists in the set.                                                                     |
| insert      | \<string>            | _bool_      | Inserts the string into the set if it doesn't already exist. Returns **True** if successful.                                    |
| merge       | <**StringSet**:from> | _none_      | Merges the contents of another **StringSet** with this one.                                                                     |
