'函數(shù)名:CreateKeyWord '作 用:由給定的字符串生成關(guān)鍵字 '參 數(shù):Constr---要生成關(guān)鍵字的原字符串 '返回值:生成的關(guān)鍵字 '************************************************** 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,"nbsp;","") 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