Contact Us 1-800-596-4880

startsWith

startsWith(String, String): Boolean

Returns true or false depending on whether the input string starts with a matching prefix.

Parameters

Name Description

text

The input string.

prefix

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

%dw 2.0
output application/json
---
[ "Mari" startsWith("Mar"), "Mari" startsWith("Em") ]

Output

[ true, false ]