技术文章
首页
关于我们
网站模板
客户案例
网站建设
程序开发
联系我们
技术文章
seo
asp.net
JavaSript
asp
网站建设
asp判断字符串是否以指定字符串开头或结尾
时间:2009-03-25 点击:2224
<%
'判断字符串Str1是否以指定字符串Str2开头
Public Function BeginWith(ByVal Str1, ByVal Str2)
Dim Length
Length = Len(Str2)
If Left(Str1, Length) = Str2 Then
BeginWith = True
Else
BeginWith = False
End If
End Function
'判断字符串Str1是否以指定字符串Str2结尾
Public Function EndWith(ByVal Str1, ByVal Str2)
Dim Length
Length = Len(Str2)
If Right(Str1, Length) = Str2 Then
EndWith = True
Else
EndWith = False
End If
End Function
%>
<form name="form1" method="post" action="">
<p> 输入两个字符串:</p>
<p> 字符串1:
<input name="text1" type="text" id="text">
</p>
<p> 字符串2:
<input name="text2" type="text" id="text">
<input type="submit" name="Submit" value="提交">
</p>
</form>
<%
Dim X,Y
X=Request.Form("text1")
Y=Request.Form("text2")
If X<>"" and Y<>"" Then
%>
<p>字符串1:<%=X%></p>
<p>字符串2:<%=Y%></p>
<p>字符串1是否以指定字符串2开头?:<%=BeginWith(X,Y)%></p>
<p>字符串1是否以指定字符串2结尾?:<%=EndWith(X,Y)%></p>
<%
End If
%>
event.srcElement
层在flash下面的解决方法
验证视图状态 MAC 失败
asp创建和调整动态数组
asp计算中英文混合字符串的长度
> 返回
地址:上海市普陀区胶州路941号长久商务中心 电话: QQ:
© Copyright 2012 上海网络
Product
All Rights Reserved