컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
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
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 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"]]