Returns the n-th token/sub-string in a string after splitting it using a given delimiter.
Syntax
NxTokenize(String, Delimiter, Order)
- String
- is the input string to match for.
- Delimiter
- is the character to use for splitting the string. If missing, a comma (,) is used.
- Order
- is the order of the token to return, where first = 1, second = 2, ..., and last = -1. If missing, the first token is returned.
Remarks
- The delimiter may contain any number of characters, but only the first one is used.
- The NxTokenize function trims the input string's leading and trailing white spaces.
- If the input string does not contain the delimiter character, NxTokenize returns a #VALUE! error.
- If the order value exceeds the number of tokens in the string, NxTokenize returns a #VALUE! error.
Examples
Formula | Description (Result) |
---|---|
=NxTokenize("this is a string"," ",1) | this |
=NxTokenize("this is a string"," ",4) | string |
=NxTokenize("find/the/substring","/") | find |
=NxTokenize("gu!ess}the/del-imet!er","!",2) | ess}the/del-imet |
Files Examples
Related Links
References
- Jeffrey E.F. Friedl (2006). Mastering Regular Expressions (3rd edition). Oreilly Media. ISBN 0-596-52812-4.
Comments
Article is closed for comments.