推薦:ASP中的EVAL函數(shù)使用教程近兩日,學(xué)習(xí)了ASP的EVAL函數(shù)。感覺上很實(shí)用,如果使用得當(dāng),能減輕很多代碼的編寫量,也使得代碼更加簡(jiǎn)潔明了。 EVAL函數(shù)的原型: EVAL(expression) 其中expression是字符串參數(shù),可以是表達(dá)式,可以是變量,甚至可以是語句。但都是以字符串的形式出現(xiàn)。 例如 b=EVA
Function FormatStr(str)
Dim s1,s2
If str<>"" then
str=replace(replace(Trim(str),chr(32)&chr(32),""),chr(9),"")
DO While (instr(str,">")>0 and instr(str,"<")>0)
s1=InStr(str,"<")
s2=Instr(s1,str,">")
If s1>0 and s2>0 then
str=replace(str,mid(str,s1,s2-s1+1),"")
End if
Loop
str=replace(replace(str,"<","<"),">",">")
str=Replace(Replace(Replace(replace(replace(str,chr(13),""),chr(10),""),"""","”"),"'","’")," ","")
FormatStr=str
Else
FormatStr=""
End if
End Function
分享:ASP 高亮顯示不區(qū)分大小寫的關(guān)鍵字今日,碰到一個(gè)問題:如何在網(wǎng)頁中高亮顯示不區(qū)分大小寫的關(guān)鍵字 例如:文本abcaBcabCaBCabcaBCa,關(guān)鍵字bc,在不區(qū)分大小寫的情況,一共有6個(gè)匹配項(xiàng)。 則在網(wǎng)頁中顯示的是abcaBcabCaBCabcaBCa。 很多人,想到是replace函數(shù)。原型為 Replace(string,find,replacewith[,
新聞熱點(diǎn)
疑難解答
圖片精選