Text.RemoveControlCharacters
----------------------------

Removes control characters.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Text](component_Text.md) | [5.1](newinversion51.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "Text.RemoveControlCharacters"; Text ) 

**MBS**( **"Text.RemoveControlCharacters";** /\* Removes control characters. \*/  
**$Text**) /\* The text to process.e.g. "Hello World" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Text | The text to process. | "Hello World" |

### Result

Returns text or error.

### Description

Removes control characters.  
Leaves tab, return and new line characters in the text, but removes other characters with code point &lt;32.  
See also [Text.ReplaceNewLine](TextReplaceNewLine.md) for replacing line endings.  
  
Rewritten for version 12.1 to preserve text styles.  
### Examples

Remove control characters test:

 Length(MBS ( "Text.RemoveControlCharacters"; "Hello" &amp; Char(3) &amp; "World" ))  
<small>  
Example result: 10</small>Do cleanup in a calculated field:

 MBS (“Text.RemoveControlCharacters”; self)  
Remove a BOM Character:

 Length(MBS ("Text.RemoveControlCharacters"; "Hello" &amp; Char(65279)))  
<small>  
Example result: 5</small>### See also

- [Text.FilterASCII](TextFilterASCII.md)
- [Text.ReplaceNewLine](TextReplaceNewLine.md)

### Release notes

- **Version 15.3**
    - Improved [Text.RemoveControlCharacters](https://www.mbsplugins.eu/TextRemoveControlCharacters.shtml) function to also remove BOM character.
- **Version 12.1**
    - Rewrote [Text.RemoveControlCharacters](https://www.mbsplugins.eu/TextRemoveControlCharacters.shtml), [Text.ConvertUnicodeToCharacterDecomposition](https://www.mbsplugins.eu/TextConvertUnicodeToCharacterDecomposition.shtml) and [Text.ConvertUnicodeToCharacterComposition](https://www.mbsplugins.eu/TextConvertUnicodeToCharacterComposition.shtml) functions to preserve text styles.

### Example Databases

- [WebViewer/TinyMCE/TinyMCE](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/WebViewer/TinyMCE/TinyMCE.shtml#6ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 15.3pr1](https://www.mbsplugins.de/archive/2025-06-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 12.1pr2](https://www.mbsplugins.de/archive/2022-02-08/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 12.1pr1](https://www.mbsplugins.de/archive/2022-02-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 22nd April 2015 , last changed 16th May 2025

  
[Text.RemoveAccentsCaseInsensitive](TextRemoveAccentsCaseInsensitive.md) - [Text.RemoveNewLine](TextRemoveNewLine.md)

[HTML Version](TextRemoveControlCharacters.shtml)