# GetStringToken2

## Description

Returns a specific token from a string separated by the given delimiter, for example a string containing "first:second:third" has three tokens delimited by ":". Similar to GetStringToken except that this command accepts only a single character as the delimiter and recognises empty fields. For example "first:second::fourth" has four tokens with the third being an empty string. In tier 2 the returned string must be deleted when you are done with it. You can use CountStringTokens2 to count the number of tokens in the string.

## Definition

string GetStringToken2( str, delimiter, token )

char* agk::GetStringToken2( const char* str, const char* delimiter, int token )

## Parameters

- str - The string to check.
- delimiter - The character that delimits the string.
- token - the index of the token to return, starting at 1 for the first token.