There isn't anything in the API that will specifically do this. You will most likely need to write your own code to do it instead. One important fact that you didn't mention is how the number is represented. Is it an int or a float or a String or something else? If it's a String, you can use the suggestion above. Even if it's an int or float, you can easily convert it to a String. However, there's an easier way if you understand integer arithmetic. Specifically, you should look at integer division and modulus operations. I won't give any more details because I think you should research this on your own. If you need any clarifications from there, let us know.
Will you always know the number ahead of time? If so then something like could work. What if you don't know the number ahead of time (of course if you do know the number ahead of time then you don't need code do you)? What will be the second operand of the your mod expression if the number entered is 41506? Do you need just one number at a time or sometimes the first two numbers, etc...?
You are almost there, Matt. However, what if you have a variable x and x%40 is greater than 10? What will you do then? It seems like you would need to do a long chain of if...else statements. I think this is what everyone else is trying to point out. So can you figure out a way to get the one's digit with a SINGLE modulus operation, without any if statements or other control structure? (Hint: go back and read Joel's post again.)