Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
arrays.concat
arrays.concat(string_array, string_array)
Deskripsi
Menampilkan array string baru dengan menyalin elemen dari array string asli.
Jenis data parameter
ARRAY_STRINGS
, ARRAY_STRINGS
Jenis hasil yang ditampilkan
ARRAY_STRINGS
Contoh kode
Contoh 1
Contoh berikut menggabungkan dua array string yang berbeda.
arrays.concat(["test1", "test2"], ["test3"]) = ["test1", "test2", "test3"]
Contoh 2
Contoh berikut menggabungkan array dengan string kosong.
arrays.concat([""], [""]) = ["", ""]
Contoh 3
Contoh berikut menggabungkan array kosong.
arrays.concat([], []) = []
Kecuali dinyatakan lain, konten di halaman ini dilisensikan berdasarkan Lisensi Creative Commons Attribution 4.0, sedangkan contoh kode dilisensikan berdasarkan Lisensi Apache 2.0. Untuk mengetahui informasi selengkapnya, lihat Kebijakan Situs Google Developers. Java adalah merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-07-29 UTC.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-07-29 UTC."],[[["\u003cp\u003e\u003ccode\u003earrays.concat\u003c/code\u003e is a function that returns a new string array by combining elements from two input string arrays.\u003c/p\u003e\n"],["\u003cp\u003eThis function is supported in Rules and Search contexts within the specified platform.\u003c/p\u003e\n"],["\u003cp\u003eIt accepts two \u003ccode\u003eARRAY_STRINGS\u003c/code\u003e as parameters and returns an \u003ccode\u003eARRAY_STRINGS\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eEmpty string arrays can be passed as parameters, resulting in an empty or combined array as per the operation.\u003c/p\u003e\n"],["\u003cp\u003eThe elements passed as parameters to this method are copied to a new array.\u003c/p\u003e\n"]]],[],null,["### arrays.concat\n\nSupported in: \n[Rules](/chronicle/docs/detection/default-rules) [Search](/chronicle/docs/investigation/udm-search) \n\n arrays.concat(string_array, string_array)\n\n#### Description\n\nReturns a new string array by copying elements from original string arrays.\n\n#### Param data types\n\n`ARRAY_STRINGS`, `ARRAY_STRINGS`\n\n#### Return type\n\n`ARRAY_STRINGS`\n\n#### Code samples\n\n##### Example 1\n\nThe following example concatenates two different string arrays. \n\n arrays.concat([\"test1\", \"test2\"], [\"test3\"]) = [\"test1\", \"test2\", \"test3\"]\n\n##### Example 2\n\nThe following example concatenates arrays with empty string. \n\n arrays.concat([\"\"], [\"\"]) = [\"\", \"\"]\n\n##### Example 3\n\nThe following example concatenates empty arrays. \n\n arrays.concat([], []) = []"]]