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

熱點內容
消失的眼角膜電影視頻在線觀看 瀏覽:749
離子交換填料種類 瀏覽:604
紅羊公司奄的台灣四季片 瀏覽:973
純水處理記錄表格樣式 瀏覽:839
床戲電影名字 瀏覽:788
電影實時票房查詢貓眼 瀏覽:857
樹脂貼面的強度是多少 瀏覽:668
ro膜銷售合同 瀏覽:420
蒸餾水和雅漾噴霧 瀏覽:305
污水處理廠有休息嗎 瀏覽:583
小米凈化器怎麼不顯示數值 瀏覽:467
樹脂瓦上可以澆灌水泥嗎 瀏覽:434
下水道除水垢的方法 瀏覽:811
怎麼更換六代雅閣空調濾芯 瀏覽:298
污水流程沉澱需要什麼物品 瀏覽:233
凈水器顯示002什麼意思 瀏覽:844
可看網站 瀏覽:651
濾水器怎麼清理濾芯 瀏覽:38
什麼是液壓提升器 瀏覽:69
怎麼種植樹脂大戟 瀏覽:950