%dw 2.0
output application/json
---
[ "Mari" startsWith("Mar"), "Mari" startsWith("Em") ]DataWeave
startsWith
startsWith(text: String, prefix: 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
startsWith(text: Null, prefix: Any): false
Helper function that enables startsWith to work with a null value.
Introduced in DataWeave version 2.4.0.



