检查某个字符串是否仅含有数字(0-9)字符.
StringIsDigit ( "字符串" )
字符串 | 要检查的字符串 |
成功: | 返回值为 1. |
失败: | 返回值为 0 说明给定的字符串含有非数字字符. |
$x1 = "12333"
MsgBox(0,"检查结果", "返回值为:" & StringIsDigit($x1));返回值为: 1
$x2 = "1.5"
MsgBox(0,"检查结果", "返回值为:" & StringIsDigit($x2));返回值为: 0, 由于有小数点
$x3 = "1 2 3"
MsgBox(0,"检查结果", "返回值为:" & StringIsDigit($x3));返回值为: 0, 由于有空白符
$x4 = ""
MsgBox(0,"检查结果", "返回值为:" & StringIsDigit($x4));返回值为: 0