透過集合功能整理內容
你可以依據偏好儲存及分類內容。
strings.url_decode
strings.url_decode(url_string)
說明
提供網址字串後,解碼逸出字元並處理已編碼的 UTF-8 字元。如果解碼失敗,則傳回空白字串。
參數資料類型
STRING
傳回類型
STRING
程式碼範例
範例 1
這個範例顯示正向測試案例。
strings.url_decode("three%20nine%20four") = "three nine four"
範例 2
這個範例顯示空字串案例。
strings.url_decode("") // ""
範例 3
這個範例顯示如何處理非字母字元。
strings.url_decode("%E4%B8%8A%E6%B5%B7%2B%E4%B8%AD%E5%9C%8B") // "上海+中國"
範例 4
這個範例顯示網址解碼範例。
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;'
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間: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"]],["上次更新時間:2025-07-29 (世界標準時間)。"],[[["\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;'"]]