内容显示页
 
类别:ASP+VBS | 浏览(380) | 2007-6-21 13:34:20



可修改代码后再运行


'名称:多个空格替换成一个及其扩展函数
'作者:柳永法
'网址:http://www.yongfa365.com/item/too-space-to-one-space.html
'日期:2007-6-18
Function delspace(Str) Set re = New RegExp re.IgnoreCase = True re.Global = True re.Pattern = " +" delspace = re.Replace(Str, " ") End Function Function reReplace(Str, restrS, restrD) Set re = New RegExp re.IgnoreCase = True re.Global = True re.Pattern = restrS reReplace = re.Replace(Str, restrD) End Function Str = "www.yongfa365.com 这个网站不错, 真的没人知道吗, 太可惜了 hohop" MsgBox delspace(Str), , "第一个函数delspace,只替换多个空格为一个" MsgBox reReplace(Str, " +", " "), , "第二个函数reReplace,自定义正则替换成,自定义的内容。" MsgBox reReplace(Str, " +", "@")

引用本页地址:http://www.yongfa365.com/item/too-space-to-one-space.html
 
 
相关链接
 
网友评论:
1 求学不老 - 2007-6-21 13:49:41
我顶撒!
 
2 匿名网友 - 2008-4-6 17:33:46
是不错 哈哈顶一把
 
3 YANG - 2008-9-3 17:25:42
很好,找了一个小时,自己也想半天,在你这搞定了
 
姓名: 记住我
网址:
邮箱:
内容:
验证码:  验证码图片 看不清? 换张图试试
 
     
 
 
文章分类
 
 
专题(3)
 
.Net + C#(41)
 
ASP+VBS(153)
 
 
 
Linux(10)
 
 
 
web 2.0(24)
 
 
 
 
 
心程(59)
 
生活(80)
 
 
     

Power by :柳永法(yongfa365)'Blog | Model by :hibaidu | CSS by:众网友 | 京ICP备07011491号  QQ:64049027  E-mail:64049027qq.com

本空间赞助商:北京中科兴联信息技术有限公司