How do i count all the charactars in a %var

for example:

in the var "%test" i have "i am just testing"

"i am just testing" are 17 characters, but how do i return that in a script? ($count doesnt do what i want)