# String Variable Rules

## String: When Rules

1. **changes**: Gets triggered if the string variable undergoes a change.
2. **is =**: If the value or input of a string variable matches a certain number, a specific action can be triggered.
3. **is in the list / is not in the list** - If the value or input of a string variable is present or not present in a predefined comma-separated list, a certain action can be triggered.

<figure><img src="https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mgll1jjQMRTVj7p6n7g%2Fuploads%2FLxw3LWP5C1ORfmfibkc0%2Fimage.png?alt=media&#x26;token=8f43c358-ed57-495c-b6ff-ce49d3e6d0e4" alt=""><figcaption><p>String: When Rules</p></figcaption></figure>

## String: Then Rules

1. **reset to default value** - This will set the variable back to its default value.
2. **capture data** - This action copies the value from the "When" side of the rule. Check [#capturing-user-input](https://docs.gmetri.com/metaverse/variables/string-substitution#capturing-user-input "mention").
3. **append capture data** - Appends the captured value (as opposed to completely replacing the current string with the captured value).
4. **set to string** - Sets it to a string value.
5. **find and replace -**  provided the ability to locate specific text, letters within a string variable and replace them with a desired value, and store the resulting value in this string variable.

<figure><img src="https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mgll1jjQMRTVj7p6n7g%2Fuploads%2FqBMA5OPO61EdyMOuUJ94%2Fimage.png?alt=media&#x26;token=7363a697-8521-41aa-96b9-9a08dbb7d2b8" alt=""><figcaption><p>String: Then Rules</p></figcaption></figure>
