Function
In the process of using the Replace () function, a general tutorial or book is used-
Replace (str, "AAA", "BBB")
In fact, sometimes we pay too much attention to the teaching of books, the use of the function itself is not considered from the VB Script rules.
such as the rules for the Replace function, the example above can be written as:
Replace (variables, constants, constants)
Oh, smart you will be reflected here at this time? Can the latter two parameters of--replace () be variable???
Try to test it quickly ... Here's a sample:
Dim var1,str2,str1
Var1=request.form ("title")
Str1=rs ("content")
Str2=replace (str1,var1,var1& "Web Teaching Network")
The above code indicates that the STR1 is added to the page teaching Web character with the content represented by the variable var1.
Through this example, you can take a reverse three, with the replace () function to achieve more powerful features.
Further, also remind the ASP enthusiasts,VB function is more flexible application, we can not only adhere to the book knowledge, more in the actual operation of the accumulation of a variety of application experience and skills.