How many characters in a variable?

Does anyone know, how to count the number of characters in a variable ?

Eg…

 
var smth = "mynameisB7";

this should return 10