contains
Description
Returns true
if the given substring appears anywhere in a string; otherwise return false
. The check is case sensitive. For case-insensitive matching, normalize both values with toLowerCase()
or toUpperCase()
before calling contains
.
Syntax
Like many functions in DataPrime, contains
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 search (haystack) |
substring | string | true | The substring to look for within the full string (needle) |
Example
Check if an AWS Account ID appears in an ARN
Sometimes only a broader field such as an ARN is available. Use contains
to test for the presence of the account ID.
Output
Both notations produce a field is_from_account
that is true
if the ARN contains the account ID.
Theme
Light