# How to replace all occurences of a pattern from a text

4WS.Platform provides a method to replace all occurrences of a pattern from a string:

```javascript
replaceAll(stringa,pcFrom, pcTo);
```

this function will return the new text with replaced pattern;

## Example

```javascript
replaceAll("hello world","l","x");
```

will return “hexxo worxd”.
