# PurgeChar - script and chart function

PurgeChar() returns a string consisting of the characters contained in the input string ('text'), excluding any that appear in the second argument ('remove\_chars').

Syntax:

PurgeChar(text, remove\_chars)

Return data type: string

Arguments:

PurgeChar arguments

| Argument | Description |
| --- | --- |
| text | The original string. |
| remove\_chars | A string containing the characters in text to be removed. |

**Return data type:** string

Examples and results:

Examples and results

| Example | Result |
| --- | --- |
| `PurgeChar<br>( 'a1b2c3','123' )` | Returns 'abc' |
| `PurgeChar<br>( 'a1b2c3','312' )` | Returns 'abc' |

## Learn more

* [KeepChar - script and chart function](https://help.qlik.com/en-US/qlikview/May2024/Subsystems/Client/Content/QV_QlikView/Scripting/StringFunctions/KeepChar.htm)