---
title: std.replaceall
summary: null
url: >-
  https://www.fastly.com/documentation/reference/vcl/functions/strings/std-replaceall
---

```
STRING std.replaceall(STRING s, STRING target, STRING replacement)
```

**Available in:** all subroutines

Replaces all occurrences of the literal string `target` in string `s` with 
`replacement`. If no matches are found, no replacements are made. If `target` 
is the empty string, the original string `s` is returned.

Once a replacement is made, substitutions continue from the end of the
replaced buffer. Therefore, `std.replace("aaa", "a", "aa")` will return a
string "aaaa" instead of recurring indefinitely.

## Example

```vcl
set req.url = std.replaceall(req.url, "+", "%2520"); # "+" is not a special character
```
