Built-in Functions → splitPart

splitPart() is a string function that returns an element of a delimited string. The function parses the string value in segments by string delimiters and returns the segment indicated by int findNum.

Note

The word before a delimiter corresponds to an index value of "1" and the one after corresponds to an index value of "2". If the same delimiter is repeated after the second word, then the following word corresponds to an index value of "3".

Signature

splitPart(string value, string delimiters,int findNum)

The following table illustrates the splitPart() parameters:

ParameterDescription
string valuedelimited string to search
string delimitersstring representing the delimiters
int findNumindex int of the element to return

Returns

string

Example

Find and return the second element of the '-' delimited string "Apples-Oranges-Bananas".

splitPart("Apples-Oranges-Bananas","-",2)

In this example, splitPart returns "Oranges".