函数说明

StringIsInt

检查某个字符串是否整型数。

StringIsInt ( "字符串" )

 

参数

字符串 目标字符串。

 

返回值

成功: 返回值为1。
失败: 返回值为0,说明给定的字符串无法识别为整数。

 

注意

StringIsInt 对非字符串的整数表达式也返回 1;但是,如果是十六进制的表达式如 "4ff0" 等则 StringIsInt 的返回值为0。字符串中唯一允许含有的标点符号是在开头(首字符)的加号或减号。

 

相关

StringIsFloat, StringIsDigit, IsInt

 

示例


StringIsInt("+42")  ;返回值为 1
StringIsInt("-00")  ;返回值为 1
StringIsInt("1.0")  ;返回值为 0,因为含有小数点
StringIsInt(1.0)    ;返回值为 1,由数字-字符串转换规则决定
StringIsInt("1+2")  ;返回值为 0,因为含有加号