countTokens function

Count tokens by splitting strings