Slice (listText, itemNumber, delimiter)

Result Type: Text

Definition: Returns one item from a textual list of items. The list can be delimited by any character you like. A delimiter of "\n" is useful for slicing out a row from the result of the Analyse() function.

Examples: Slice ("foo,bar,baz", 2, ",")

returns the second element (“bar”) of the comma-delimited list.

Note The "\n" delimiter behaves slightly differently, in that it is not removed from the element returned. Thus

Slice ("foo\nbar\nbaz", 2, "\n")

returns “bar\n”.

See Also:

Dice: Get a subcomponent of a delimited tabular string

Head: Get some elements from the start of a delimited string

Left: Get characters from the start of a string

Mid: Get characters from the middle of a string

Regex_Match: Test whether a string matches a regular expression

Regex_Replace: Replace text in a string using a regular expression

Regex_Search: Find the first match of a regular expression in a string

Replace: Replace matching text in a string with new text

Right: Get characters from the end of a string

Tail: Get some elements from the end of a delimited string

Trim: Remove whitespace from beginning and end of a string