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

熱點內容
天籟換汽油濾芯手工多少錢 瀏覽:65
精細蒸餾 瀏覽:566
美塑樹脂價位 瀏覽:862
農村污水處理工程匯報 瀏覽:881
山東聊城沙鎮污水處理廠 瀏覽:741
擠出纖維增強樹脂 瀏覽:507
環境凈化器怎麼樣 瀏覽:592
飲水機為什麼會長綠毛 瀏覽:114
水處理吸附劑反應設備 瀏覽:547
RO膜凈水器燒的水有水垢 瀏覽:337
酸鹼噴淋塔廢水如何處理 瀏覽:464
Nacl能透過玻璃紙半透膜嗎 瀏覽:875
廈門密閉式污水提升設備多少錢 瀏覽:793
無泵凈水機哪個牌子好 瀏覽:562
團星節能飲水機怎麼換濾芯 瀏覽:654
後排凈水器哪個牌子好 瀏覽:752
純凈水反滲透設備廠家供應 瀏覽:425
新碧純凈水哪裡生產的 瀏覽:891
飲水機碳粉怎麼清洗 瀏覽:294
汽油過濾器機油過濾器 瀏覽:31