Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
strings.url_decode
strings.url_decode(url_string)
Deskripsi
Mengingat string URL, dekode karakter escape dan tangani karakter UTF-8 yang telah dienkode. Menampilkan string kosong jika decoding gagal.
Jenis data parameter
STRING
Jenis hasil yang ditampilkan
STRING
Contoh kode
Contoh 1
Contoh ini menunjukkan kasus pengujian positif.
strings.url_decode("three%20nine%20four") = "three nine four"
Contoh 2
Contoh ini menunjukkan kasus string kosong.
strings.url_decode("") // ""
Contoh 3
Contoh ini menunjukkan penanganan karakter non-alfabet.
strings.url_decode("%E4%B8%8A%E6%B5%B7%2B%E4%B8%AD%E5%9C%8B") // "上海+中國"
Contoh 4
Contoh ini menunjukkan contoh dekode URL.
strings.url_decode("http://www.google.com%3Fparam1%3D%22+1+%3E+2+%22%26param2%3D2%3B") // 'http://www.google.com?param1="+1+>+2+"¶m2=2;'
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\u003estrings.url_decode\u003c/code\u003e decodes URL strings, handling escape characters and encoded UTF-8 characters, and is supported in Rules and Search.\u003c/p\u003e\n"],["\u003cp\u003eThe function returns an empty string if the URL decoding fails.\u003c/p\u003e\n"],["\u003cp\u003eIt accepts a single parameter of the type \u003ccode\u003eSTRING\u003c/code\u003e representing the URL string to decode and it also returns a \u003ccode\u003eSTRING\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eIt effectively handles non-alphabet characters in addition to standard URL encoding.\u003c/p\u003e\n"]]],[],null,["### strings.url_decode\n\nSupported in: \n[Rules](/chronicle/docs/detection/default-rules) [Search](/chronicle/docs/investigation/udm-search) \n\n strings.url_decode(url_string)\n\n#### Description\n\nGiven a URL string, decode the escape characters and handle UTF-8 characters that have been encoded. Returns empty string if decoding fails.\n\n#### Param data types\n\n`STRING`\n\n#### Return type\n\n`STRING`\n\n#### Code samples\n\n##### Example 1\n\nThis example shows a positive test case. \n\n strings.url_decode(\"three%20nine%20four\") = \"three nine four\"\n\n##### Example 2\n\nThis example shows an empty string case. \n\n strings.url_decode(\"\") // \"\"\n\n##### Example 3\n\nThis example shows non-alphabet characters handling. \n\n strings.url_decode(\"%E4%B8%8A%E6%B5%B7%2B%E4%B8%AD%E5%9C%8B\") // \"上海+中國\"\n\n##### Example 4\n\nThis example shows a sample URL decoding. \n\n strings.url_decode(\"http://www.google.com%3Fparam1%3D%22+1+%3E+2+%22%26param2%3D2%3B\") // 'http://www.google.com?param1=\"+1+\u003e+2+\"¶m2=2;'"]]