This question includes numbers with leading zeros and numbers which normally counted as hexadecimal(like 09).Assume user input is integer,because i pass number to some function as integer.
For example
- if user inputs 5 i should get 1
- if user inputs 0005 i should get 4
- if user inputs 09 i should get 2
(Note)Below method does not work:
String.valueOf(integer).length()