asp 字符串截取

来源:百度知道 编辑:UC知道 时间:2024/06/03 13:16:48
如字符串:
/html.asp?id=1/1447/254462.html&

我想截取 1/1447 或者 id=1/1447/ 或者 id=1/1447
数字位数 不定的~~ 翻页就会变 按位数截取不成功的

<%
id = request("id")
strlen = InStrRev(id,"/")
response.Write left(id,strlen-1) '截取1/1447

response.Write "id="&left(id,strlen) '截取id=1/1447/

response.Write "id="&left(id,strlen-1) '截取id=1/1447
%>

请根据需要自己作相应的修改

判断这个值第一个/号之前的值 以及第一和第二/之间的值,这个应该是使用正则表达式来获取。