About 17,500,000 results
Open links in new tab
  1. What's the difference between str.isdigit (), isnumeric () and ...

    s.isdigit() s.isnumeric() s.isdecimal() I always get as output either all True or all False for each value of s (which is a string). What's the difference between the three? Can you provide an example that gives …

  2. How to take the nth digit of a number in python - Stack Overflow

    Sep 23, 2016 · This solution solves many more "digit of a number" problems than the one using integer division and modulus. Try to find the leading (left-most) digit of the following numbers using both: …

  3. python - Does "\d" in regex mean a digit? - Stack Overflow

    123 Only 1 and 3 are matched by the regex \d; 2 is not. Generally for a sequence of digit numbers without other characters in between, only the odd order digits are matches, and the even order digits …

  4. math - C: how to break apart a multi digit number into separate ...

    Feb 3, 2018 · Say I have a multi-digit integer in C. I want to break it up into single-digit integers. 123 would turn into 1, 2, and 3. How can I do this, especially if I don't know how many digits the integer...

  5. Format string to a 3 digit number - Stack Overflow

    169 If you're just formatting a number, you can just provide the proper custom numeric format to make it a 3 digit string directly:

  6. regex - How do I write a Regular Expression to match any three digit ...

    May 14, 2013 · 0 It sounds like you're trying to do a find / replace in Visual Studio of a 3 digit number (references to Express and Find/Replace tool). If that's the case the regex to find a 3 digit number in …

  7. JavaScript math, round to two decimal places - Stack Overflow

    I have the following JavaScript syntax: var discount = Math.round(100 - (price / listprice) * 100); This rounds up to the whole number. How can I return the result with two decimal places?

  8. How to check if a character in a string is a digit or letter?

    I have the user entering a single character into the program and it is stored as a string. I would like to know how I could check to see if the character that was entered is a letter or a digit. I ...

  9. R regular expressions: unexpected behavior of " [:digit:]"

    Nov 1, 2013 · I'd like to extract elements beginning with digits from a character vector but there's something about POSIX regular expression syntax that I don't understand. I would think that vec <- …

  10. Shorter way to check if a string is not isdigit ()

    May 2, 2013 · For the sake of learning, is there a shorter way to do: if string.isdigit () == False : I tried: if !string.isdigit () : and if ! (string.isdigit ()) : which both didn't work.