使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
arrays.join_string
arrays.join_string(array_of_strings, optional_delimiter)
说明
将字符串数组转换为单个字符串,并使用可选参数进行分隔。如果未提供分隔符,则使用空字符串。
形参数据类型
ARRAY_STRINGS
,STRING
返回类型
STRING
代码示例
以下是一些有关如何使用该函数的示例:
示例 1
此示例将包含非 null 元素的数组与分隔符联接起来。
arrays.join_string(["foo", "bar"], ",") = "foo,bar"
示例 2
此示例将包含 null 元素和分隔符的数组联接起来。
arrays.join_string(["foo", NULL, "bar"], ",") = "foo,bar"
示例 3
此示例将一个包含非 null 元素且没有分隔符的数组联接起来。
arrays.join_string(["foo", "bar"]) = "foobar"
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-29。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-07-29。"],[[["\u003cp\u003eThe \u003ccode\u003earrays.join_string\u003c/code\u003e function merges an array of strings into a single string.\u003c/p\u003e\n"],["\u003cp\u003eAn optional delimiter can be used to separate the string elements; otherwise, strings will be concatenated without a separator.\u003c/p\u003e\n"],["\u003cp\u003eNull elements within the array are ignored during the string concatenation process.\u003c/p\u003e\n"],["\u003cp\u003eThis function is compatible with Chronicle's default rules and search functionalities.\u003c/p\u003e\n"]]],[],null,["### arrays.join_string\n\nSupported in: \n[Rules](/chronicle/docs/detection/default-rules) [Search](/chronicle/docs/investigation/udm-search) \n\n arrays.join_string(array_of_strings, optional_delimiter)\n\n#### Description\n\nConverts an array of strings into a single string separated by the optional parameter. If no delimiter is provided, the empty string is used.\n\n#### Param data types\n\n`ARRAY_STRINGS`, `STRING`\n\n#### Return type\n\n`STRING`\n\n#### Code samples\n\nHere are some examples of how to use the function:\n\n##### Example 1\n\nThis example joins an array with non-null elements and a delimiter. \n\n arrays.join_string([\"foo\", \"bar\"], \",\") = \"foo,bar\"\n\n##### Example 2\n\nThis example joins an array with a null element and a delimiter. \n\n arrays.join_string([\"foo\", NULL, \"bar\"], \",\") = \"foo,bar\"\n\n##### Example 3\n\nThis example joins an array with non-null elements and no delimiter. \n\n arrays.join_string([\"foo\", \"bar\"]) = \"foobar\""]]