Dear statalists,

I would like to count the number of digits an observation has as follows:
Number Distinct
00000000000 1
000001111444 3
etc. etc.
does somebody have an idea which function I can use?

Thank you!

Felix