# replace\_args

Source: https://zotonic.com/docs/1825/replace_args

URI: https://zotonic.com/id/1825

Language: en



Replace `$N` placeholders in string from a list of replacement values.

The input string is searched for any `$N` tags, which is replaced with the N‘th value from the list of arguments supplied to the filter.

Example usage:

```django
{{ "Replace $1 and give it some $2."|replace_args:["item", "meaning"] }}
```

Will result in: “Replace item and give it some meaning.”

The `$N` tag may be escaped by \\ to avoid replacement.

N may be in the range \[1..9\]. If N is out of range of the provided args, the $N tag is left as-is.

The $N tags may come in any order, any number of times.

When replacing a single tag, the replacement argument may be given directly:

```django
{{ "John is $1"|replace_args:"the one" }}
```

Outputs: “John is the one”

New in version 0.8.

License: 

Attribution: 

Related resources: https://zotonic.com/api/agent/related/1825?language=en


## API access

- [API help](<https://zotonic.com/api-help>)
- [OpenAPI specification](<https://zotonic.com/openapi.json>)
- [This resource as JSON](<https://zotonic.com/api/agent/resource/1825?language=en>)
