欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

asp下實現(xiàn)字符串的補充fill()

 更新時間:2008年02月15日 16:10:58   作者:  
在一個字符串前后補全另一字符串,在一個字符串前面補全另一字符串,在一個字符串后面補全另一字符串
復制代碼 代碼如下:

<% 
'功能:在一個字符串前后補全另一字符串 
'來源:http://jorkin.reallydo.com/article.asp?id=452 

Public Function Fill(ByVal sString, ByVal sStr) 
    Fill = RFill(LFill(sString, sStr), sStr ) 
End Function 
%> 


復制代碼 代碼如下:

<% 
'功能:在一個字符串前面補全另一字符串 
'來源: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 For 
    Next 
    LFill = Left(sStr, iStrLen - i) & sString 
End Function 
%> 

復制代碼 代碼如下:

<% 
'功能:在一個字符串后面補全另一字符串 

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 For 
    Next 
    RFill = sString & Mid(sStr, i + 1) 
End Function 
%> 

例如:
<%=RFill(LFill("www.dbjr.com.cn/article.asp","http://"),"article.asp?id=452")%>

相關(guān)文章

最新評論