%dw 2.0
import remove from dw::core::Strings
output application/json
---
"lazyness purity state higher-order stateful" remove "state"
DataWeave
remove
remove(text: String, toRemove: String): String
Removes all occurrences of a specified pattern from a string.
Introduced in DataWeave version 2.4.0.
Parameters
Name | Description |
---|---|
|
The text to remove from. |
|
The pattern to remove. |
Example
This example shows how the remove
can be used to remove some unwanted properties.
Source
Output
"lazyness purity higher-order ful"
Json
remove(text: Null, toRemove: Any): Null
Helper function that enables remove
to work with a null
value.
Introduced in DataWeave version 2.4.0.