CreateKeyWord asp实现的由给定的字符串生成关键字的代码

''************************************************** ''函数名:CreateKeyWord ''作用:由给定的字符串生成关键字 ''参数:Constr---要生成关键字的原字符串 ''返回值:生成的关键字 ''************************************************** FunctionCreateKeyWord(byvalConstr,Num) IfConstr=''orIsNull(Constr)=

作者: 来源: 时间: 17-11-23 15:38:47

''**************************************************
''函数名: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,"”","")
   Constr=Replace(Constr,"&","")  
   Constr=Replace(Constr,"gt;","")      
   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
   ConstrTemp=left(ConstrTemp,len(ConstrTemp)-1)
   ConstrTemp= Right(ConstrTemp,len(ConstrTemp)-1)
   CreateKeyWord=ConstrTemp
End Function
11
22
33
隐藏区块

会员注册

本功能为预留功能,暂不支持注册 ^_^

Login

社交帐号登陆

使用以下任意帐号可登陆本站

Close section
Close

联系我们

关于5UCMS 您有任何需求 均可以留言给我们