---
name: "BIS_fnc_filterString"
type: function
status: ok
groups: ["Strings"]
arma3_since: "1.00"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/BIS_fnc_filterString
revid: 327982
updated: 2022-07-13T15:22:00Z
---

# BIS_fnc_filterString

*Function · Strings · Arma 3 v1.00*

## Description

Removes characters from a string based on the list of allowed characters.

## Syntax

```sqf
[text, allowedChars] call BIS_fnc_filterString
```

**Parameters:**

- **text:**: [String](../topics/String.md) - text to filter
- **allowedChars**: [String](../topics/String.md) - (Optional, default a..z, A..Z, 0..9, "_") allowed characters

**Returns:** [String](../topics/String.md) - filtered text with only the allowed characters supplied in the filter.

## Examples

### Example 1

```sqf
["Player 1 @%!@$"] call BIS_fnc_filterString; // returns "Player1"
```

### Example 2

```sqf
["Player 1", "aelrPy"] call BIS_fnc_filterString; // returns "Player"
```

## See also

[find](../commands/find.md) · [BIS_fnc_inString](../functions/BIS_fnc_inString.md) · [splitString](../commands/splitString.md) · [joinString](../commands/joinString.md)

<sub>Source: [BI Community Wiki — BIS fnc filterString](https://community.bistudio.com/wiki/BIS_fnc_filterString) (revision 327982).</sub>
