> For the complete documentation index, see [llms.txt](https://www.onescript.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.onescript.org/onescript-overview/sets.md).

# Sets

Unlike many other languages, OneScript supports the ability to store, combine and test options that may represent options selected by recipient of a survey. The Set type takes the following basic form:

```csharp
{ident[,ident]}
```

For example:

```csharp
{a,b,c}
```

> Sets do not support whitespace between the ident values.

It is possible to combine sets for example:

```csharp
Set e1 = {a,b,c};
Set e2 = {g,h,i};
e1 = e1 + {d};                // Result is {a,b,c,d}
e1 = e1 - {a};                // Result is {b,c,d}
e1 = e1 + e2;                 // Result is {b,c,g,h,i}
```

It is also possible to test whether a Set is present in a value is:

```csharp
Set e1 = {a,b,c};
Set e2 = e1 & {a};            // Result is {a}
e2 = e1 & {h};                // Result {}
e2 = e1 | {h};                // Result is {a,h}
```

Sets are case insensitive:

```
Set e1 = {A,b,c};
Set e2 = {g,h,i};
e1 = e1 + {D};                // Result is {a,b,c,D}
e1 = e1 - {a};                // Result is {b,c,d}
e1 = e1 + e2;                 // Result is {b,c,g,h,i}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://www.onescript.org/onescript-overview/sets.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
