MS Access Replace() 函式
示例
在字串中將“i”替換為“a”
SELECT Replace("My name is Willy Wonka", "i", "a") AS ReplaceString;
定義和用法
Replace() 函式可以指定次數將字串內的子字串替換為另一個子字串。
語法
Replace(string1, find, replacement, start, count, compare)
引數值
引數 | 描述 |
---|---|
string1 | 必需。原始字串 |
查詢值 | 必需。要在 string1 中搜索的子字串 |
replacement | 必需。要在 string1 中替換 find 的子字串 |
start | 可選。開始搜尋 string1 的起始位置。如果省略,則預設為 1 |
count | 可選。要執行的替換次數。如果省略,則會替換 find 的所有出現次數為 replacement |
比較 | 可選。字串比較的型別。 可能的值 -1:使用 Option Compare 的設定 0:二進位制比較 1:文字比較 2:基於資料庫資訊的比較 |
技術詳情
支援版本 | 從 Access 2000 開始 |
---|