%dw 2.0
import * from dw::core::Strings
output application/json
---
{
a: reverse("Mariano"),
b: reverse(null),
c: reverse("")
}
DataWeave
reverse
reverse(text: String): String
Reverses sequence of characters in a string.
Introduced in DataWeave version 2.4.0.
Parameters
Name | Description |
---|---|
|
The string to reverse. |
Example
This example shows how reverse
behaves with different inputs.
Source
Output
{
"a": "onairaM",
"b": null,
"c": ""
}
Json
reverse(text: Null): Null
Helper function that enables reverse
to work with a null
value.
Introduced in DataWeave version 2.4.0.