手机
当前位置:查字典教程网 >编程开发 >ASP教程 >ASP字符串转换为整形、双精度型、布尔
ASP字符串转换为整形、双精度型、布尔
摘要:Rem将字符串转换为整形数据functiontoInteger(str,num)str=trim(str)ifstr=""ornotisnu...

Rem将字符串转换为整形数据

functiontoInteger(str,num)

str=trim(str)

ifstr=""ornotisnumeric(str)then

toInteger=num

else

toInteger=clng(str)

endif

endfunction

Rem将字符串转换为双精度型数据

functiontoDouble(str)

str=trim(str)

ifstr=""ornotisnumeric(str)then

toDouble=0.0

else

toDouble=cdbl(str)

endif

endfunction

Rem将字符串转换为布尔数据

functiontoBoolean(str)

str=lcase(trim(str))

ifstr="true"orstr="t"then

toBoolean=true

elseifisnumeric(str)then

ifclng(str)<>0thentoBoolean=true

else

toBoolean=false

endif

endfunction

【ASP字符串转换为整形、双精度型、布尔】相关文章:

javascript asp教程第八课--request对象

ASP获得上月、本月、下月的第一和最后一天

[ASP]使用类,实现模块化

实例分析ASP上传漏洞入侵实战及扩展

ASP中FormatDateTime函数用法详解

ASP中一个字符串处理类

ASP如何获取真实IP地址

ASP中将视频文件转换成.flv格式

javascript asp教程第二课--转义字符

ASP 非法字符过滤函数

精品推荐
分类导航