Length
Determines how many numbers compose the integer if it was represented as a string.
Source
public static int Length(this int i)
{
if (i <= 0) throw new ArgumentOutOfRangeException();
return (int)Math.Floor(Math.Log10(i)) + 1;
}
Example
int ir = 84372;
Console.WriteLine(ir.Length()); //will write 5