splitParts
Description
Splits a string using a delimiter and return the token at the specified index. The index starts at 1, not 0.
Syntax
Like many functions in DataPrime, splitParts
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 split |
delimiter | string | true | The delimiter used to split the string |
index | number | true | The 1-based index of the token to return |
Example
Extract the domain from an email address
Consider the following document:
Use splitParts
to extract the domain in one step:
Output
Theme
Light