作家
登录

ASP字符串转换为整形、双精度型、布尔

作者: 来源:www.28hudong.com 2013-03-30 08:29:00 阅读 我要评论

Rem 将字符串转换为整形数据 function toInteger(str,num) str=trim(str) if str="" or not isnumeric(str) then toInteger=num else toInteger=clng(str) end if end function Rem 将字符串转换为双精度型数据 function toDouble(str) str=trim(str) if str="" or not isnumeric(str) then toDouble=0.0 else toDouble=cdbl(str) end if end function Rem 将字符串转换为布尔数据 function toBoolean(str) str=lcase(trim(str)) if str="true" or str="t" then toBoolean=true elseif isnumeric(str) then if clng(str)<>0 then toBoolean=true else toBoolean=false end if end function

  推荐阅读

  海阳2006+功能中的潜水王

ps:我还没测试。 信息来源:H4×0r's Blog 复制代码 代码如下:bOtherUser = False ''是否需要其它NT用户身份登录 If bOtherUser = True And Trim(Request.ServerVariables("AUTH_USER")) = "" Then Response.Sta>>>详细阅读


本文标题:ASP字符串转换为整形、双精度型、布尔

地址:http://www.17bianji.com/kaifa2/ASP/32236.html

关键词: 探索发现

乐购科技部分新闻及文章转载自互联网,供读者交流和学习,若有涉及作者版权等问题请及时与我们联系,以便更正、删除或按规定办理。感谢所有提供资讯的网站,欢迎各类媒体与乐购科技进行文章共享合作。

网友点评
自媒体专栏

评论

热度

精彩导读
栏目ID=71的表不存在(操作类型=0)