CopyCode The Code is as follows: <%
'Function: add another string before and after a string
'Source: http://jorkin.reallydo.com/article.asp? Id = 452
Public Function fill (byval sstring, byval SSTR)
Fill = rfill (lfill (sstring, SSTR), SSTR)
End Function
%>Copy codeThe Code is as follows: <%
'Function: add another string to the front of a string
'Source: http://jorkin.reallydo.com/article.asp? Id = 452
Public Function lfill (byval sstring, byval SSTR)
Dim istrlen: istrlen = Len (SSTR &"")
For I = istrlen to 1 step-1
If right (SSTR, I) = left (sstring, I) Then exit
Next
Lfill = left (SSTR, istrlen-I) & sstring
End Function
%>
Copy codeThe Code is as follows: <%
'Function: add another string to the end of a string
Public Function rfill (byval sstring, byval SSTR)
Dim istrlen: istrlen = Len (SSTR &"")
For I = istrlen to 1 step-1
If left (SSTR, I) = right (sstring, I) Then exit
Next
Rfill = sstring & Mid (SSTR, I + 1)
End Function
%>
For example:
<% = Rfill (lfill ("www.jb51.net/article.asp", "http: //"), "article. asp? Id = 452 ") %>