Divide by a multiple of ten with a number of zeroes equal to the number of digits you want to skip. Not sure if that's the best way to explain it, so here's an example.
If you have the number 1234 and you want the first digit, you're skipping 3 digits so divide it by 1000. 1234/1000 = 1. If you want the first 2 digits, divide by 100. 1234/100 = 12. Because both operands are ints, the result is a truncated int. This is a simple way to get the first n digits of a number.