Use $len() to return characters.
If you want to do words, it depends. you'd have to get a little bit more complex. If you want to specify words based on spaces (the standard), then you could use tokens.
An example would be $numtok($1-,32) would return the number of different 'words' in a string using spaces as the seperator. Of course, you could run into problems and would have to be a little more complicated on the code if you did say, the following:
how are you ?
It would count the ? as an extra word, because of the space there.