Use & implement string connection in asp
Simple string concatenation
response.write "Vevb.com"&"Wrong new webmaster site"
Multiple string concatenation
<%gettj="<a href=""https://www.Vevb.com/tools/zhengze.html"" 30-minute tutorial for regular expressions"" target=""_blank""">30-minute tutorial for regular expressions</a>"&vbcrlfgettj=gettj&"<a href=""https://www.Vevb.com/article/181099.htm""Reveal the mystery of regular expressions (produced by regexlab)"" target=""_blank""">Reveal the mystery of regular expressions (produced by regexlab)</a>"&vbcrlfgettj=gettj&"<a href=""http://tools.Vevb.com/regex/javascript/""JavaScript regular expression online test tool"" target=""_blank"""""JavaScript regular expression online test tool</a>"&vbcrlfgettj=gettj&"<a href=""https://www.Vevb.com/tools/regexsc.htm""regexquire table"" target=""_blank"""""regexquire table""&vbcrlfgettj=gettj&"<a href=""https://www.Vevb.com/tools/regex.htm""Common regular expressions"" target=""_blank""">Common regular expressions</a>"&vbcrlfresponse.write gettj%>
It's better to worry-free in js +=
ASP - String splicing class
In ASP, when you want to splice strings, the first one used is definitely &. Later, in a project, I found that when splicing super long strings, the efficiency of using & is extremely low. Using join splicing strings can improve efficiency by hundreds of times.
<%Class appendStringPrivate arrIndex, arrUbound, arrList()Private Sub Class_Initialize()'Assign 10 length redim arrList(10)'Current length arrIndex = 0'End each time expand the length arrUbound = 10End SubPrivate Sub Class_Terminate()'Release all arrays, when used again, you need to reassign Erase arrListEnd Sub'Set the value and dynamically expand the length Public Default Sub Add(value)arrList(arrIndex) = valuearrIndex = arrIndex + 1if arrIndex > arrUbound thenarrUbound = arrUbound + 50redim preserve arrList(arrUbound)end ifEnd Sub'Return the string Public Function getString(splitString)redim preserve arrList(arrIndex - 1)getString = join(arrList,splitString)End FunctionEnd Class'Calling method Set StringClass = New appendStringStringClass.add("I")StringClass.add("Love")StringClass.add("Edit")StringClass.add("Process")OutputString = StringClass.getString("")' print result is: I love programming %>The above is the detailed content of the asp string concatenation character &, multiple string addition, and string splicing. For more information about asp string concatenation characters, please pay attention to other related articles of the Error New Webmaster website!