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


代码如下:
<%
‘功能:在一个字符串前后补全另一字符串
‘来源:https://jorkin.reallydo.com/article.asp?id=452

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

代码如下:
<%
‘功能:在一个字符串前面补全另一字符串
‘来源:https://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.phpstudy.net/article.asp”,”https://”),”article.asp?id=452″)%>

—-想了解更多的linux相关异常处理怎么解决关注<计算机技术网(www.ctvol.com)!!>



本文来自网络收集,不代表计算机技术网立场,如涉及侵权请联系管理员删除。

ctvol管理联系方式QQ:251552304

本文章地址:https://www.ctvol.com/htmltutorial/75443.html

(0)
上一篇 2020年4月20日
下一篇 2020年4月20日

精彩推荐