欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

asp正則過濾重復(fù)字符串的代碼

 更新時間:2008年06月28日 01:09:21   作者:  
asp下過濾重復(fù)字符串的代碼,有時候我們需要過濾一些重復(fù)的字符串,下面的代碼即可解決這個問題
比如 1223445677777778aabbcccccccccc 經(jīng)過過濾之后就是12345678abc
復(fù)制代碼 代碼如下:

<%    
'過濾重復(fù)   
Function norepeat(Str)    
Dim RegEx    
If IsNull(Str) Or Str="" Then Exit Function   
Set RegEx=New RegExp    
    RegEx.Global = True   
    RegEx.IgnoreCase=True   
    RegEx.MultiLine = True   
    RegEx.pattern="(.)\1+"   
    str=regEx.replace(str,"$1")    
    Set RegEx=Nothing   
Norepeat=str    
End Function   

'示例    
s="1223445677777778aabbcccccccccc"   

response.write Norepeat(s)    
%> 

相關(guān)文章

最新評論