Get integer digits

Is there a way to get the number of digits in integers? For instance:

int a = 12345;

I want to determine what ahas 5 digits

+3
source share
1 answer
int a = 12345;
int length = a.ToString().Length;      // returns 5
+6
source

Source: https://habr.com/ru/post/1760949/


All Articles