由给定的字符串生成关键字
程序员文章站
2022-06-21 22:58:07
'函数名:createkeyword '作 用:由给定的字符串生成关键字 '参 数:constr---要生成关键字的原字符串 '...
'函数名:createkeyword
'作 用:由给定的字符串生成关键字
'参 数:constr---要生成关键字的原字符串
'返回值:生成的关键字
'**************************************************
function createkeyword(byval constr,num)
if constr="" or isnull(constr)=true or constr="$false$" then
createkeyword="$false$"
exit function
end if
if num="" or isnumeric(num)=false then
num=2
end if
constr=replace(constr,chr(32),"")
constr=replace(constr,chr(9),"")
constr=replace(constr," ","")
constr=replace(constr," ","")
constr=replace(constr,"(","")
constr=replace(constr,")","")
constr=replace(constr,"<","")
constr=replace(constr,">","")
constr=replace(constr,"""","")
constr=replace(constr,"?","")
constr=replace(constr,"*","")
constr=replace(constr,"|","")
constr=replace(constr,",","")
constr=replace(constr,".","")
constr=replace(constr,"/","")
constr=replace(constr,"\","")
constr=replace(constr,"-","")
constr=replace(constr,"@","")
constr=replace(constr,"#","")
constr=replace(constr,"$","")
constr=replace(constr,"%","")
constr=replace(constr,"&","")
constr=replace(constr,"+","")
constr=replace(constr,":","")
constr=replace(constr,":","")
constr=replace(constr,"‘","")
constr=replace(constr,"“","")
constr=replace(constr,"”","")
dim i,constrtemp
for i=1 to len(constr)
constrtemp=constrtemp & "|" & mid(constr,i,num)
next
if len(constrtemp)<254 then
constrtemp=constrtemp & "|"
else
constrtemp=left(constrtemp,254) & "|"
end if
createkeyword=constrtemp
end function
'作 用:由给定的字符串生成关键字
'参 数:constr---要生成关键字的原字符串
'返回值:生成的关键字
'**************************************************
function createkeyword(byval constr,num)
if constr="" or isnull(constr)=true or constr="$false$" then
createkeyword="$false$"
exit function
end if
if num="" or isnumeric(num)=false then
num=2
end if
constr=replace(constr,chr(32),"")
constr=replace(constr,chr(9),"")
constr=replace(constr," ","")
constr=replace(constr," ","")
constr=replace(constr,"(","")
constr=replace(constr,")","")
constr=replace(constr,"<","")
constr=replace(constr,">","")
constr=replace(constr,"""","")
constr=replace(constr,"?","")
constr=replace(constr,"*","")
constr=replace(constr,"|","")
constr=replace(constr,",","")
constr=replace(constr,".","")
constr=replace(constr,"/","")
constr=replace(constr,"\","")
constr=replace(constr,"-","")
constr=replace(constr,"@","")
constr=replace(constr,"#","")
constr=replace(constr,"$","")
constr=replace(constr,"%","")
constr=replace(constr,"&","")
constr=replace(constr,"+","")
constr=replace(constr,":","")
constr=replace(constr,":","")
constr=replace(constr,"‘","")
constr=replace(constr,"“","")
constr=replace(constr,"”","")
dim i,constrtemp
for i=1 to len(constr)
constrtemp=constrtemp & "|" & mid(constr,i,num)
next
if len(constrtemp)<254 then
constrtemp=constrtemp & "|"
else
constrtemp=left(constrtemp,254) & "|"
end if
createkeyword=constrtemp
end function
上一篇: EDG逆风翻盘夺得英雄联盟冠军!电子竞技职业化终见成果
下一篇: c# 删除文件与删除文件夹