主頁(yè) > 知識(shí)庫(kù) > ASP中Split分割字符串函數(shù)的實(shí)例用法

ASP中Split分割字符串函數(shù)的實(shí)例用法

熱門(mén)標(biāo)簽:梧州市地圖標(biāo)注 濟(jì)源電銷(xiāo)外呼系統(tǒng)線(xiàn)路 石家莊慧營(yíng)銷(xiāo)外呼系統(tǒng) 創(chuàng)意電話(huà)機(jī)器人 世界地圖標(biāo)注了哪些城市 外呼線(xiàn)路批發(fā) 武穴地圖標(biāo)注 地圖標(biāo)注陽(yáng)江 java外呼系統(tǒng)是什么

ASP中Split函數(shù)的用法
分割截取字符串
看幾個(gè)例子就能理解了

復(fù)制代碼 代碼如下:

mystr="1,2,3,4,5"
mystr=split(mystr,",")
for i=0 to ubound(mystr)
response.write mystr(i)
next 
'返回值為123456

mystr="xlei.net/http/student/x/index.asp"
mystr=split(mystr,"/http/student")
for i=0 to ubound(mystr)
response.write mystr(i)
next 
'返回值為xlei.net/x/index.asp

mystr="1批在2批在3批在4批是在5批在"
mystr=split(mystr,"批在")
for i=0 to ubound(mystr)
response.write mystr(i)
next 
'返回值為1234批是在56


描述
返回基于 0 的一維數(shù)組,其中包含指定數(shù)目的子字符串。
語(yǔ)法
Split(expression[, delimiter[, count[, start]]])
Split 函數(shù)的語(yǔ)法有以下參數(shù):

參數(shù) 描述
expression 必選。字符串表達(dá)式,包含子字符串和分隔符。如果 expression 為零長(zhǎng)度字符串,Split 返回空數(shù)組,即不包含元素和數(shù)據(jù)的數(shù)組。
delimiter 可選。用于標(biāo)識(shí)子字符串界限的字符。如果省略,使用空格 ("") 作為分隔符。如果 delimiter 為零長(zhǎng)度字符串,則返回包含整個(gè) expression 字符串的單元素?cái)?shù)組。
count 可選。被返回的子字符串?dāng)?shù)目,-1 指示返回所有子字符串。
compare 可選。指示在計(jì)算子字符串時(shí)使用的比較類(lèi)型的數(shù)值。有關(guān)數(shù)值,請(qǐng)參閱“設(shè)置”部分。

設(shè)置
compare 參數(shù)可以有以下值:
常數(shù) 值 描述
vbBinaryCompare 0 執(zhí)行二進(jìn)制比較。
vbTextCompare 1 執(zhí)行文本比較。
vbDatabaseCompare 2 執(zhí)行基于數(shù)據(jù)庫(kù)(在此數(shù)據(jù)庫(kù)中執(zhí)行比較)中包含的信息的比較。

引用來(lái)自 asp端驗(yàn)證是否包含非法字符

復(fù)制代碼 代碼如下:

username=replace(trim(request.form("username")),"'","''")
password=replace(trim(request.form("password")),"'","''")

if instr(username,"%") or instr(username,"#") or instr(username,"?") or instr(username,"|") then
     response.write "script. language=javascript>alert('您的姓名含有非法字符!');history.back()/script>"
     response.end
     end if
if instr(password,"%") or instr(password,"#") or instr(password,"?") or instr(password,"|") then
     response.write "script. language=javascript>alert('您的密碼含有非法字符!');history.back()/script>"
response.end
end if

您可能感興趣的文章:
  • Perl split字符串分割函數(shù)用法指南
  • php字符串分割函數(shù)explode的實(shí)例代碼
  • js split 的用法和定義 js split分割字符串成數(shù)組的實(shí)例代碼
  • php+正則將字符串中的字母數(shù)字和中文分割

標(biāo)簽:淮北 南寧 唐山 揭陽(yáng) 滁州 來(lái)賓 迪慶 甘南

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《ASP中Split分割字符串函數(shù)的實(shí)例用法》,本文關(guān)鍵詞  ASP,中,Split,分割,字符串,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問(wèn)題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無(wú)關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《ASP中Split分割字符串函數(shù)的實(shí)例用法》相關(guān)的同類(lèi)信息!
  • 本頁(yè)收集關(guān)于ASP中Split分割字符串函數(shù)的實(shí)例用法的相關(guān)信息資訊供網(wǎng)民參考!
  • 企业400电话

    智能AI客服机器人
    15000

    在线订购

    合计11份范本:公司章程+合伙协议+出资协议+合作协议+股权转让协议+增资扩股协议+股权激励+股东会决议+董事会决议

    推薦文章