---
url: /flow/guide/scripting-reference/functions/string/stringreplaceall.md
---

# StringReplaceAll

## Declaration

`Function StringReplaceAll( const S, OldPattern, NewPattern : string) : string`

### Example

```pascal
procedure OnMapEvent(var Value:Variant);
begin
 Value := StringReplaceAll('abc#def#g','#','|'); //returns 'abc|def|g'
end;
```

## Description

Replaces all occurrences of OldPattern with NewPattern in S string. OldPattern can be one or more characters. NewPattern can be one or more characters, or it can be blank which effectively removes all occurrences of OldPattern.
