首页 | 心情日记 | 建站心得 | 编程技术 | 大盘分析 | 股市信息 | 学习园地 | 电脑技巧 | 物流外贸 | 另类其它 | 站长推荐 | 给我留言 | 相册

用户登陆
用户:
密码:
 
不保存保存一天
保存一月保存一年

站点日历
73 2024 - 3 48
     12
3456789
10111213141516
17181920212223
24252627282930
31


站点统计

最新评论

日志搜索

 标题   内容


关于nofollow ASP在线操作备份和恢复MSSQL数据库
未知 asp取两字符串之间的字符串的函数   [ 日期:2010-03-15 10:11:59 ]   [ 来自:本站原创 ]

海外邮件中继,海外退信中继,美国高速VPS,不限流量VPN,邮局维护和管理,邮件网关,EMOS邮件中继,POSTFIX邮件中继,Winwebmail邮件中继,Winmail邮件中继,DBMail邮件中继,JDMail邮件中继,Exchange邮件中继,MDaemon邮件中继 淘宝店:http://shantan.taobao.com 云邮科技官网:www.yunrelay.com

【字体设置:
<%
'取中间字符串
function getmidstr(L,R,str)
 
  int_left=instr(str,L)
  int_right=instr(str,R)

  If int_left>0 and int_right>0 Then 
  getmidstr=mid(str,int_left+len(L),int_right-int_left-len(L))
  Else
  getmidstr="执行的字符串中不包含“"&L&"”或“"&R&"”" 

  End If
end function

str="123456789"
response.write "<BR>"&getmidstr("23","78",str) 
’将输出"456"
%> 

扩展模式:
<%
'取中间字符串
function getmidstr(L,R,str,m,n) 
          'm,n为控制参数,表示输出的字符串将分别向左,向右多输出m,n个字符。 
  int_left=instr(str,L)
  int_right=instr(str,R)

  if (m="left") then   '若m为“left”,输出的字符串将包含左边部分(L),下同 
  m=len(L)
  end if
  if (n="right") then 

  n=len(R)
  end if

  if (m>(len(L)+int_left-1)) then 
  m=(len(L)+int_left-1)
  end if
  If int_left>0 and int_right>0 Then 

  getmidstr=mid(str,int_left+len(L)-m,int_right-int_left-len(L)+n+m)
  Else
  getmidstr="执行的字符串中不包含“"&L&"”或“"&R&"”" 

  End If
end function

str="abcdefghijk"
response.write "<BR>"&getmidstr("bcd","hi",str,0,0)  


‘输出"efg"
response.write "<BR>"&getmidstr("bcd","hi",str,2,1)  


‘输出"cdefgh"
response.write "<BR>"&getmidstr("bcd","hi",str,"left","right")  
‘输出"bcdefghi"
%>

暂时没有评论
   发表评论 - 不要忘了输入验证码哦!
作者: 用户:  密码:  我要注册 验证码: 
为防止广告注册机程序,验证码不会自动显示,请点击此处显示或者(刷新)验证码!
评论:

禁止表情
禁止UBB
禁止图片
识别链接
识别关键字
确定发布?
最多可以输入200个字,目前你已经输入了0个字;你今日还可以发表10条评论!
 
   

CopyRight © 2008-2010 广东金融学院030904班 All Rights Reserved
Powered by www.030904.com