Enum MatchType
比對類型
列舉字串值的配對方式。比對字串是布林運算。在提供字串、比對字詞 (字串) 和比對類型後,作業會在下列情況下輸出 true
:
- 如果比對類型等於「完全比對」,且比對字詞等於字串。
- 如果比對類型等於 PREFIX,且比對字詞是字串的前置字串。
- 如果比對類型等於 ANY,且比對字詞是字串的子字串。
這個列舉可由字串篩選器控制項使用,用於決定要從資料表中篩除哪些資料列。指定要篩選的資料欄,並使用上述任一種比對類型,只保留與篩選輸入框中輸入的值相符的資料列。
如要呼叫列舉,請呼叫其父項類別、名稱和屬性。例如
Charts.MatchType.EXACT
。
屬性
屬性 | 類型 | 說明 |
EXACT | Enum | 僅比對完全相符的值 |
PREFIX | Enum | 從值開頭開始比對前置字串 |
ANY | Enum | 比對任何子字串 |
方法
方法 | 傳回類型 | 簡短說明 |
getName() | String | 傳回要在選項 JSON 中使用的比對類型名稱。 |
內容詳盡的說明文件
getName()
傳回要在選項 JSON 中使用的比對類型名稱。
回攻員
String
:類型的名稱。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-12-02 (世界標準時間)。
[null,null,["上次更新時間:2024-12-02 (世界標準時間)。"],[[["`MatchType` is an enumeration used to define how a string value should be matched against a given search term."],["It provides three options: `EXACT`, `PREFIX`, and `ANY` for matching exact values, prefixes, and substrings respectively."],["This enumeration can be utilized by string filter controls to filter data table rows based on user input and the selected match type."],["Calling a `MatchType` property is done using the parent class, name, and desired property, for instance, `Charts.MatchType.EXACT`."],["The `getName()` method is available to retrieve the name of the match type for use in JSON options."]]],["MatchType defines string matching criteria. `EXACT` requires an exact string match. `PREFIX` checks if the match term is at the beginning of the string. `ANY` verifies if the match term is a substring. This determines if a row should be kept when filtering a data table. `getName()` returns the match type's name. The enum can be called using `Charts.MatchType.[property]` (e.g., `Charts.MatchType.EXACT`).\n"]]