%dw 2.0
import * from dw::util::Coercions
output application/json indent=false
---
{
a: toArray(""),
b: toArray("hola")
}
DataWeave
toArray
toArray(@StreamCapable text: String): Array<String>
Splits a String
value into an Array
of characters.
Introduced in DataWeave version 2.4.0.
Parameters
Name | Description |
---|---|
|
The |
Example
This example shows how toArray
behaves with different inputs.
Source
Output
{"a": [],"b": ["h","o","l","a"]}
Json