コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
strings.contains
strings.contains( str, substr )
説明
指定された文字列に指定された部分文字列が含まれている場合に true を返します。それ以外の場合は false を返します。
パラメータのデータ型
STRING
、STRING
戻り値の型
BOOL
コードサンプル
例 1
この例では、文字列に部分文字列「is」が含まれているため、true が返されます。
strings.contains("thisisastring", "is") = true
例 2
この例では、文字列に部分文字列「that」が含まれていないため、false が返されます。
strings.contains("thisisastring", "that") = false
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-29 UTC。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-07-29 UTC。"],[[["\u003cp\u003eThe \u003ccode\u003estrings.contains\u003c/code\u003e function checks if a string contains a specific substring.\u003c/p\u003e\n"],["\u003cp\u003eIt is available in both Rules and Search functionalities within the platform.\u003c/p\u003e\n"],["\u003cp\u003eThe function takes two string parameters: the string to search within and the substring to search for.\u003c/p\u003e\n"],["\u003cp\u003eIt returns a boolean value, \u003ccode\u003etrue\u003c/code\u003e if the substring is found, and \u003ccode\u003efalse\u003c/code\u003e otherwise.\u003c/p\u003e\n"]]],[],null,["### strings.contains\n\nSupported in: \n[Rules](/chronicle/docs/detection/default-rules) [Search](/chronicle/docs/investigation/udm-search) \n\n strings.contains( str, substr )\n\n#### Description\n\nReturns true if a given string contains the specified substring. Otherwise it returns false.\n\n#### Param data types\n\n`STRING`, `STRING`\n\n#### Return type\n\n`BOOL`\n\n#### Code samples\n\n##### Example 1\n\nThis example returns true because the string has a substring \"is\". \n\n strings.contains(\"thisisastring\", \"is\") = true\n\n##### Example 2\n\nThis example returns false because the string does not have substring \"that\". \n\n strings.contains(\"thisisastring\", \"that\") = false"]]