導航:首頁 > 凈水問答 > 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搜索過濾相關的資料

熱點內容
液相用溶劑過濾器 瀏覽:674
納濾水導電率 瀏覽:128
反滲透每小時2噸 瀏覽:162
做一個純凈水工廠需要多少錢 瀏覽:381
最終幻想4回憶技能有什麼用 瀏覽:487
污水提升器采通 瀏覽:397
反滲透和不發滲透凈水器有什麼區別 瀏覽:757
提升泵的揚程 瀏覽:294
澤德提升泵合肥經銷商 瀏覽:929
飲水機後蓋漏水了怎麼辦 瀏覽:953
小型電動提升器 瀏覽:246
半透膜和細胞膜區別 瀏覽:187
廢水拖把池 瀏覽:859
十四五期間城鎮污水處理如何提質增效 瀏覽:915
怎麼測試空氣凈化器的好壞 瀏覽:519
提升泵是幹嘛的 瀏覽:744
布油做蒸餾起沫咋辦 瀏覽:252
廣州工業油煙凈化器一般多少錢 瀏覽:204
喜哆哆空氣凈化器效果怎麼樣 瀏覽:424
油煙凈化器油盒在什麼位置 瀏覽:582