%dw 2.0
output application/json
---
[ "Mari" startsWith("Mar"), "Mari" startsWith("Em") ]
DataWeave
startsWith
startsWith(String, String): Boolean
Returns true
or false
depending on whether the input string starts with a
matching prefix.
Parameters
Name | Description |
---|---|
|
The input string. |
|
A string that identifies the prefix. |
Example
This example indicates whether the strings start with a given prefix.
Note that you can use the startsWith(text,prefix)
or
text startsWith(prefix)
notation (for example,
startsWith("Mari","Mar")
or "Mari" startsWith("Mar")
).
Source
Output
[ true, false ]
JSON