Digital detection

xiaoxiao2021-03-05  21

Get the text box to get the String object, if it is a digital judgment, you can proceed as follows:

Directly use Double.Valueof (String), if there is NumberFormATexception, it means not a number

: P

Public static boolean isnumber (string toinden) {Try {Double.Valueof (toinden); return true;} catch (Exception E) {Return False;}}

转载请注明原文地址:https://www.9cbs.com/read-32381.html

New Post(0)