---
url: /cube-functions/togglestring.md
description: Adds or removes a substring from a delimited string.
---

# TOGGLESTRING

Adds or removes a substring from a delimited string. If the substring is found, it is removed; otherwise, it is added with the specified separator.

```js
TOGGLESTRING(inputstring, substring, separator)
```

#### Parameters

* `inputstring` - The original string to modify.
* `substring` - The substring to add or remove.
* `separator` - The separator used to delimit multiple substrings.

#### Examples

```js
TOGGLESTRING("a,b,c", "b", ",")
```

**Result:** `a,c`

**Note:** Removes 'b' from the string 'a,b,c'.
