Contact Free trial Login

with

with(((V, U) -> R) -> X, (V, U) -> R): X

When used with replace, with passes a replacement.

Example

This example replaces all numbers in a string with "x" characters.

Source

%dw 2.0
output application/json
---
{ "ssn" : "987-65-4321" replace /[0-9]/ with("x") }

Output

{ "ssn": "xxx-xx-xxxx" }

Was this article helpful?

💙 Thanks for your feedback!

Edit on GitHub