public static int GetFirstDigitLoop(int number) { while (number >= 10) { number = (number - (number % 10)) / 10; } return number; }