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

所属分类: 网络编程 / ASP编程 阅读数: 519
收藏 0 赞 0 分享
复制代码 代码如下:

<% 
'功能:在一个字符串前后补全另一字符串 
'来源: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.jb51.net/article.asp","http://"),"article.asp?id=452")%>
更多精彩内容其他人还在看

IIS访问ASP页面时报错The requested resource is in use.的解决办法

IIS访问ASP页面时报错The requested resource is in use.的解决办法
收藏 0 赞 0 分享

错误类型:Provider (0x80004005)未指定的错误 的一个处理方法

一般情况下asp可以正常运行,但只要连接数据库就提示,Microsoft JET Database Engine 错误'80004005'
收藏 0 赞 0 分享

关于“未指定的错误”的问题 的比较正解的解决方法

关于“未指定的错误”的问题 的比较正解的解决方法
收藏 0 赞 0 分享

关于asp+access的安全问题分析

关于asp+access的安全问题分析
收藏 0 赞 0 分享

把RS.GetRows看得更清楚

把RS.GetRows看得更清楚
收藏 0 赞 0 分享

ASP面向对象编程探讨及比较

ASP面向对象编程探讨及比较
收藏 0 赞 0 分享

ASP错误处理

ASP错误处理
收藏 0 赞 0 分享

web文件管理器的后续开发

web文件管理器的后续开发
收藏 0 赞 0 分享

上一篇,下一篇过程代码

上一篇,下一篇过程代码
收藏 0 赞 0 分享

一小偷类!!有兴趣的可以看看

一小偷类!!有兴趣的可以看看
收藏 0 赞 0 分享
查看更多