i$ = ItemExtract$(s$,n{,d$})

This function extracts a single item from a delimited string. The item is not removed from the string just returned as (i$). (s$) is the delimited string and (n) is the item number to be extracted. If the item number does not exist in the string an empty string is returned. As with all the delimited string functions the delimiter character (d$) is optional and will default to a comma if not specified.

The first item in a delimited string is item zero. This is to match item number to array indexes.

For example:

s$ = "zero,one,two,three,four"
i$ = ItemExtract$(s$,2)

In this example (i$) would equal "two" since it is the item at index 2. Since the delimiter character is not specified a comma is assumed to be the delimiter.

Delimited Strings

Become a Patron