当前位置:首页 > ASP教程 > 应用技巧

asp下根据标题生成关键字的代码

'function createkeywords(keywords) '关键字生成系统 dim i,l,tempstr keywords_temp=rereplace(keywords, "[x00-xff]|n| | |,|。|、|!|?|:|"|"|[|]|—|—|(|)|…", "") l=len(keywords_temp) for i=1 to l-1 tempstr=tempstr & "," & mid(keywords_temp,i,2) next createkeywords=keywords & tempstr end function function rereplace(str, restrs, restrd) '正则表达式写的替换 'made by www.yongfa365.com set re = new regexp re.ignorecase = true re.global = true re.pattern = restrs rereplace = re.replace(str, restrd) end function msgbox createkeywords("hello 你好啊, 你知道 我是谁不? ,呵呵,我是柳永法() yongfa365 知道不") [ctrl+a 全选 注:如需引入外部js需刷新才能执行]

【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:)!