Difference between unicode.isdigit() and unicode.isnumeric()

后端 未结 5 1952
孤城傲影
孤城傲影 2020-12-31 00:37

What is the difference between methods unicode.isdigit() and unicode.isnumeric()?

5条回答
  •  遥遥无期
    2020-12-31 01:36

    From the manual

    The method isnumeric() checks whether the string consists of only numeric characters. This method is present only on unicode objects.

    Digits include decimal characters and digits that need special handling, such as the compatibility superscript digits. Formally, a digit is a character that has the property value Numeric_Type=Digit or Numeric_Type=Decimal.

提交回复
热议问题