Top "Digits" questions

Questions dealing with getting, manipulating, or changing the digits of numbers

Ruby: How to find out if a character is a letter or a digit?

I just started tinkering with Ruby earlier this week and I've run into something that I don't quite know how …

ruby string character digits
Simple Number to Array with Individual Digits

I am exceptionally new to programming, but I am working on improving my skills as a programmer. Currently, I am …

java arrays digits
How to find out if letter is Alphanumeric or Digit in Swift

I want to count the number of letters, digits and special characters in the following string: let phrase = "The final …

comparison character swift digits
How to allow introducing only digits in jTextField?

I have tried to use the example shown here but java showing error message of "AttributeSet cannot be resolved to …

java swing jtextfield restriction digits
One or two numeric digits Regex

I have the below code. It works only when I have 2 digits. If I have 1 digit doesn't work. I want …

javascript regex numbers digits
Function to count number of digits in string

I was looking for a quick PHP function that, given a string, would count the number of numerical characters (i.…

php counting digits
Why does subtracting '0' in C result in the number that the char is representing?

Can someone explain why this works? char c = '9'; int x = (int)(c - '0'); Why does subtracting …

c++ c digits
Counting digits using while loop

I was recently making a program which needed to check the number of digits in a number inputted by the …

c++ while-loop digits counting
Android : How to set acceptable numbers and characters in EditText?

I have to set acceptable characters "0123456789" and "semicolon" in the EditText. Below is the code I'm using. android:digits="0123456789;" android:…

android validation android-edittext digits
Inserting spaces between digits in C

How would I go about taking a number like 123456 and having it print as 1 2 3 4 5 6?

c formatting printf digits