国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > VBScript > 正文

VBS教程:函數(shù)-InStrRev 函數(shù)

2020-07-26 12:08:08
字體:
供稿:網(wǎng)友

InStrRev 函數(shù)

返回某字符串在另一個字符串中出現(xiàn)的從結(jié)尾計起的位置。

InStrRev(string1, string2[, start[, compare]])

參數(shù)

string1

必選項。接受搜索的字符串表達式。

string2

必選項。被搜索的字符串表達式。

Start

可選項。數(shù)值表達式,用于設(shè)置每次搜索的開始位置。如果省略,則默認值為 -1,表示從最后一個字符的位置開始搜索。如果 start 包含 Null,則出現(xiàn)錯誤

compare

可選項。在計算子字符串時,指示要使用的比較類型的數(shù)值。如果省略,將執(zhí)行二進制比較。有關(guān)數(shù)值,請參閱“設(shè)置”部分。

設(shè)置

compare 參數(shù)可以有以下值:

常數(shù)Value描述
vbBinaryCompare0執(zhí)行二進制比較。
vbDatabaseCompare2執(zhí)行基于包含在數(shù)據(jù)庫(在此數(shù)據(jù)庫中執(zhí)行比較)中的信息的比較。

返回值

InStrRev 返回以下值:

如果InStrRev 返回
string1 為零長度0
string1 為 NullNull
string2 為零長度start
string2 為 NullNull
string2 沒有找到0
在 string1 中找到 string2找到匹配字符串的位置
start > Len(string2)0

說明

下面的示例利用 InStrRev 函數(shù)搜索字符串:

Dim SearchString, SearchChar, MyPosSearchString ="XXpXXpXXPXXP"   ' String to search in.SearchChar = "P"   ' Search for "P".MyPos = InstrRev(SearchString, SearchChar, 10, 0)   ' A binary comparison starting at position 10. Returns 9.MyPos = InstrRev(SearchString, SearchChar, -1, 1)   ' A textual comparison starting at the last position. Returns 12.MyPos = InstrRev(SearchString, SearchChar, 8)   ' Comparison is binary by default (last argument is omitted). Returns 0.

注意  InStrRev 函數(shù)的語法與 InStr 函數(shù)的語法并不一樣。

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 方正县| 沈丘县| 乌鲁木齐县| 乌兰浩特市| 上杭县| 开化县| 安达市| 加查县| 化隆| 招远市| 宁强县| 白朗县| 清水河县| 平阴县| 永新县| 大埔区| 勐海县| 时尚| 建瓯市| 铁力市| 盐源县| 商河县| 革吉县| 出国| 镇安县| 公主岭市| 滁州市| 衡阳市| 丹东市| 利津县| 阜平县| 正安县| 塔河县| 剑河县| 顺义区| 鄂尔多斯市| 康马县| 张掖市| 乌兰浩特市| 平遥县| 固镇县|