導航:首頁 > 凈水問答 > asp搜索過濾

asp搜索過濾

發布時間:2023-02-02 20:27:40

1. ASP中如何過濾指字文字前或指定文字後所有內容呢

可以用正則進行替換,例如以下代碼可以替換a及以後的內所有容字元
<%
str="1234agds34.32"
Dim regEx
Set regEx=new RegExp
regEx.pattern="a.*"
regEx.IgnoreCase =false
regEx.Global=True
str=regEx.Replace(str,"00000")
Response.Write "aaa="&str
%>

2. ASP如何過濾數組內重復內容

dim a(4)
a(0)=1
a(1)=1
a(2)=2
a(3)=2
a(4)=3
for n=0 to ubound(a)-1
for s=1 to ubound(a)

if a(s)=a(n) then
a(n)=""

end if
next

next
a_new=filter(a,"")『把a數組裡面是空值的全部刪掉,然後重新組合成一個a_new數組。
for n=0 to ubound(a_new)』列印出a_new數組。
response.write a_new(n)&"<br>"

next

說明:a_new是新生成的數組,去掉了a數組裡面被清空的那些,重新生成了一個開頭角標是0的a_new數組。

3. asp中如何過濾掉特殊字元

user=replace(trim(request.form("uName")),"'","''")
password=replace(trim(request.form("Password")),"'","''")
if instr(user,"%") or instr(user,"#") or instr(user,"?") or instr(user,"|") or instr(user,"'") then
response.write "<script language=javascript>alert('您的姓名含有非法字元!');this.location.href='login.asp';</script>"
response.end
end if

if instr(password,"%") or instr(password,"#") or instr(password,"?") or instr(password,"|") then
response.write "<script language=javascript>alert('您的密碼含有非法字元!');this.location.href='login.asp';</script>"
response.end
end if 我自己做的,希望對你有幫助

閱讀全文

與asp搜索過濾相關的資料

熱點內容
地熱過濾器裝反 瀏覽:740
污水泵加油加多少 瀏覽:121
前端過濾和pp 瀏覽:529
水處理超濾膜組件漏水 瀏覽:928
純水機沖洗後不排水怎麼回事 瀏覽:509
移動的飲水機安娜是什麼動漫 瀏覽:850
排100噸污水什麼後果 瀏覽:931
農村主街道污水用的什麼管 瀏覽:708
凈化器用什麼消毒器 瀏覽:641
污水處理廠殺菌燈用什麼開關電源 瀏覽:293
長安平頭麵包車機油濾芯在哪裡 瀏覽:52
為什麼不能用草酸清洗超濾 瀏覽:444
反滲透膜質保協議書 瀏覽:181
無鈉陽離子交換 瀏覽:808
聚丙烯樹脂昆侖牌價格 瀏覽:436
佛山環保廢水處理如何進行 瀏覽:742
機油濾芯廠家在哪裡 瀏覽:71
大金vrvn帶提升泵嗎 瀏覽:287
污水池太深怎麼取樣 瀏覽:18
美的反滲透濾芯怎麼判斷堵塞 瀏覽:481