--- title: "get number of tokens()" slug: "string-amount-of-tokens" updated: 2026-08-17T07:41:51Z published: 2026-08-17T07:41:51Z canonical: "docs.lobstersoftware.com/string-amount-of-tokens" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.lobstersoftware.com/llms.txt > Use this file to discover all available pages before exploring further. # get number of tokens() This function returns the number of tokens in text **a** using delimiter **b**. If a character is specified in parameter **c**, it will be interpreted as the escape character (for the delimiter, see examples). ## Parameters | Parameter | Description | | --- | --- | | a | Text. | | b | Delimiter (use *\NL* to specify a newline). | | c | (optional) The escape character for the delimiter (see examples). | ## Examples | Parameter a | Parameter b | Parameter c | Result | | --- | --- | --- | --- | | a,b,c,d | , | | 4 | | a\,b,c,d | ; | | 1 | | a\,b,c,d | , | \ | 3 | | a\\,b,c,d | , | \ | 4 |