endsWith
Description
Returns true if a string ends with a given substring, otherwise return false.
Note
Unlike contains, which checks for a substring anywhere in the string, endsWith only matches the end.
Syntax
Like many functions in DataPrime, endsWith 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 string to test |
| suffix | string | true | The substring to match against the end of the string |
Example
Check if an AWS ARN refers to a known S3 bucket
AWS S3 ARNs look like this:
To verify if the ARN points to mybucket, use endsWith:
Example query
Example output
Theme
Light