MS Access InStr() 函式
定義和用法
InStr() 函式用於獲取一個字串在另一個字串中第一次出現的位置。
此函式執行不區分大小寫的搜尋。
語法
InStr(start, string1, string2, compare)
引數值
引數 | 描述 |
---|---|
start | 可選。搜尋的起始位置。位置 1 是預設值 |
string1 | 必需。要搜尋的字串 |
string2 | 必需。要搜尋的字串 |
比較 | 可選。字串比較的型別。 可能的值 -1:使用 Option Compare 的設定 0:二進位制比較 1:文字比較 2:基於資料庫資訊的比較 |
返回值
- 如果 string2 在 string1 中未找到,則此函式返回 0
- 如果 string1 為零長度,則此函式返回 0
- 如果 string1 為 null,則此函式返回 null
- 如果 string2 為零長度,則此函式返回 start 引數的值
- 如果 start 大於 string2 的長度,則此函式返回 0
技術詳情
支援版本 | 從 Access 2000 開始 |
---|