Parsing a string?
I would like to parse a string in a loop until all the tokens have been processed.
I'm looking at StrTok from StrFunc.nsh, and it looks promising, but I don't see a way to detect when all of the tokens have been retrieved.
StrTok returns an empty string once all the tokens have been retrieved, but it can also return an empty string for empty tokens (for example, the string "Hello||World" when using pipe as a delimiter).
Yes, you can tell StrTok to skip empty tokens, but I actually need to handle empty tokens.
Any ideas how I can implement something like this (pseudocode)?
token = StrTok(stringToTokenize, delimiter)
while (token available)
{
print token
token = GetNextToken(stringToTokenize, delimiter)
}