91视频国产免费-一区二区三区不卡av-国自产拍偷拍精品啪啪av-免费在线视频一区二区-中日黄色片-免费污片在线观看-偷拍青青草-日本黄色高清-国产视频手机在线播放-国产激情在线-午夜tv影院-日本中文字幕网-男女黄色录像-日日夜夜草-九色91蝌蚪-太粗太深了太紧太爽了动态图-97久久精品

當前位置: 博客首頁 >> 網頁設計制作 >> 取兩字符串之間的字符串的函數(shù) rss

取兩字符串之間的字符串的函數(shù)

成都網站優(yōu)化 在 2010-05-03 發(fā)表,評論(0),閱讀(0)

<%
'取中間字符串
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
="執(zhí)行的字符串中不包含“"&L&"”或“"&R&""


  End If
end function

str
="www.goodtext.org"
response.write 
"<BR>"&getmidstr("go","xt",str)
’將輸出
"odte"
%
>

擴展模式:

<%
'取中間字符串
function getmidstr(L,R,str,m,n) 
          
'm,n為控制參數(shù),表示輸出的字符串將分別向左,向右多輸出m,n個字符。
  int_left=instr(str,L)
  int_right
=instr(str,R)

  
if (m="left"then   '若m為“l(fā)eft”,輸出的字符串將包含左邊部分(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
="執(zhí)行的字符串中不包含“"&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"


%
>

Tags:取中間字符串,ASP

思為網絡騰訊企業(yè)微博,請關注我們:
已有位網友對“取兩字符串之間的字符串的函數(shù)”發(fā)表評論。

 

www.sw996.com/seoblog/
西昌市| 乌拉特前旗| 剑川县| 东丽区| 兴国县| 越西县| 武安市| 无极县| 汤原县| 阳高县| 禄劝| 新营市| 砚山县| 安康市| 福州市| 天祝| 武鸣县| 永德县| 格尔木市| 沂南县| 阿坝| 白城市| 常熟市| 廊坊市| 双鸭山市| 尼木县| 云龙县| 且末县| 资溪县| 孟村| 平遥县| 宁晋县| 汉阴县| 石屏县| 潜江市| 全州县| 神池县| 社旗县| 嘉兴市| 泾阳县| 古蔺县|