最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

VBScript InStr 函數(shù)

定義和用法

InStr 函數(shù)可返回一個字符串在另一個字符串中首次出現(xiàn)的位置。

InStr 函數(shù)可返回下面的值:

  • 如果 string1 為 ""(零長度) - InStr 返回 0
  • 如果 string1 為 Null - InStr 返回 Null
  • 如果 string2 為 "" - InStr 返回 start
  • 如果 string2 為 Null - InStr 返回 Null
  • 如果 string2 沒有找到 - InStr 返回 0
  • 如果在 string1 中找到 string2,InStr 返回找到匹配字符串的位置。
  • 如果 start > Len(string1) - InStr 返回 0

提示:請參閱 InStrRev 函數(shù)

語法

InStr([start,]string1,string2[,compare])
參數(shù) 描述
start 可選的。規(guī)定每次搜索的起始位置。默認是搜索起始位置是第一個字符。如果已規(guī)定 compare 參數(shù),則必須有此參數(shù)。
string1 必需的。需要被搜索的字符串。
string2 必需的。需搜索的字符串。
compare

必需的。規(guī)定要使用的字符串比較類型。默認是 0 。可采用下列值:

  • 0 = vbBinaryCompare - 執(zhí)行二進制比較。
  • 1 = vbTextCompare - 執(zhí)行文本比較。

實例

例子 1

dim txt,pos
txt="This is a beautiful day!"
pos=InStr(txt,"his")
document.write(pos)

輸出:

2

例子 2

dim txt,pos
txt="This is a beautiful day!"
'A textual comparison starting at position 4
pos=InStr(4,txt,"is",1)
document.write(pos)

輸出:

6

例子 3

dim txt,pos
txt="This is a beautiful day!"
'A binary comparison starting at position 1
pos=InStr(1,txt,"B",0)
document.write(pos)

輸出:

0
托里县| 隆子县| 米泉市| 沁水县| 朔州市| 兰考县| 湟中县| 桦甸市| 名山县| 康保县| 宜春市| 桂林市| 城固县| 承德市| 泌阳县| 都匀市| 南开区| 勃利县| 宜宾县| 扎囊县| 唐海县| 化德县| 常州市| 建昌县| 芜湖县| 万州区| 邻水| 桂林市| 九寨沟县| 乌苏市| 东乡族自治县| 吉安市| 肥西县| 嵊泗县| 加查县| 南皮县| 卓尼县| 宝坻区| 黔东| 慈溪市| 上栗县|