Text.ReplaceAll
---------------

Find &amp; Replace all occurrences of a text.

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

MBS( "Text.ReplaceAll"; Text; Find; ReplaceWithText ) 

**MBS**( **"Text.ReplaceAll"** /\* Find &amp; Replace all occurrences of a text. \*/  
**$Text**; /\* The text to search. e.g. "Hello World" \*/   
**$Find**; /\* The text to find. e.g. "o" \*/   
**$ReplaceWithText**) /\* The new text. e.g. "a" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Text | The text to search. | "Hello World" |
| Find | The text to find. | "o" |
| ReplaceWithText | The new text. | "a" |

### Result

Returns text or error.

### Description

Find &amp; Replace all occurrences of a text.  
Quickly looks for all occurrences of a given text in another text and replaces it with a new text.  
Optimized code for extra speed if you replace one character with another character.  
  
This function works on pure text, so any text style is lost.  
### Examples

Simple replace:

 MBS ( "Text.ReplaceAll"; "Hello"; "e"; "a" )  
<small>  
Example result: "Hallo"</small>Replace emoji:

 MBS ( "Text.ReplaceAll"; "🍎🍓🍒"; "🍓"; "🍌")  
<small>  
Example result: 🍎🍌🍒</small>### See also

- [RegEx.ReplaceAll](RegExReplaceAll.md)

### Release notes

- **Version 8.3**
    - Fixed a problem with [Text.ReplaceAll](http://www.mbsplugins.eu/TextReplaceAll.shtml) causing freeze with empty string to search.
- **Version 7.3**
    - Added [Text.ReplaceAll](http://www.mbsplugins.eu/TextReplaceAll.shtml) function.

### Blog Entries

- [MBS FileMaker Plugin, version 8.3pr1](https://www.mbsplugins.de/archive/2018-06-04/MBS_FileMaker_Plugin_version_8/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 7.3pr6](https://www.mbsplugins.de/archive/2017-07-13/MBS_FileMaker_Plugin_version_7/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 13th July 2017 , last changed 31st January 2023

  
[Text.RemovePrefix](TextRemovePrefix.md) - [Text.ReplaceNewLine](TextReplaceNewLine.md)

[HTML Version](TextReplaceAll.shtml)