源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

asp下实现字符串的补充fill()

  • 时间:2021-04-21 19:23 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:asp下实现字符串的补充fill()
[u]复制代码[/u] 代码如下:
<%  '功能:在一个字符串前后补全另一字符串  '来源:http://jorkin.reallydo.com/article.asp?id=452  Public Function Fill(ByVal sString, ByVal sStr)      Fill = RFill(LFill(sString, sStr), sStr )  End Function  %> 
[u]复制代码[/u] 代码如下:
<%  '功能:在一个字符串前面补全另一字符串  '来源: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  %> 
[u]复制代码[/u] 代码如下:
<%  '功能:在一个字符串后面补全另一字符串  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.1sucai.cn/article.asp","http://"),"article.asp?id=452")%>
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部