startsWith
Description
Returns true if a string begins with a given substring, otherwise return false.
Note
Unlike contains, which checks for a substring anywhere in the string, startsWith only matches the beginning.
Syntax
Like many functions in DataPrime, startsWith supports two notations, function and method notation. These interchangeable forms allow flexibility in how you structure expressions.
Arguments
| Name | Type | Required | Description |
|---|---|---|---|
| value | string | true | The full string to test (haystack) |
| prefix | string | true | The substring to check at the start of the string (needle) |
Example
Check if a string is an AWS ARN
AWS ARNs look like this:
To confirm if a value is an ARN, check if it starts with arn::
Example query
Example output
Theme
Light