推薦:Asp Split函數之使用多個分割符的方法有時候用戶輸入的分隔符種類比較多,支持逗號也想要支持空格等等,其實原來就是先統一為一中分隔符再使用split進行分割就可以了
cint與clng含義:
都可以強制將一個表達式轉換成數據類型
cint與clng處理數據的范圍:
CInt Integer -32,768 至 32,767,小數部分四舍五入。
CLng Long -2,147,483,648 至 2,147,483,647,小數部分四舍五入。
所謂溢出指的是超出處理數據的范圍,下面復制代碼 代碼如下:www.CuoXIn.com
sub Is_Int(string)
if len(abs(string))>10 then response.write "數據溢出":response.end
if instr(string,"-")<1 then
if cint(left(string,4))>3276 and cint(right(string,1))>7 then response.write "數據溢出":response.end
else
if cint(left(abs(string),4))>3276 and cint(right(string,1))>8 then response.write "數據溢出":response.end
end if
end sub
'檢測是否是長整數
復制代碼 代碼如下:www.CuoXIn.com
sub Is_Lng(string)
if len(abs(string))>10 then response.write "數據溢出":response.end
if instr(string,"-")<1 then
if clng(left(string,9))>214748364 and clng(right(string,1))>7 then response.write "數據溢出":response.end
else
if clng(left(abs(string),9))>21478364 and clng(right(string,1))>8 then response.write "數據溢出":response.end
end if
end sub
分享:ASP中Split分割字符串函數的實例用法ASP中Split函數的用法,用split分割截取字符串,看幾個例子就能理解了