Createkeyword ASP implementation code to generate keywords from a given string application tips

Source: Internet
Author: User
'**************************************************
' Function name: Createkeyword
' Function: Generate keywords from a given string
' Parameters: Constr---The original string to generate the keyword
' Return value: the generated keyword
'**************************************************
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
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.