Amb*_*ung 2 unicode powershell decode
在PowerShell中,如何对unicode转义字符串进行转义?
$str1 = "http:\u002f\u002fgoogle.com\u002fsomething\u002ftest"
Run Code Online (Sandbox Code Playgroud)
到
http://google.com/something/test
Run Code Online (Sandbox Code Playgroud)
执行此操作的代码是:
[Regex]::Replace($str1, "\\[Uu]([0-9A-Fa-f]{4})",
{[char]::ToString([Convert]::ToInt32($args[0].Groups[1].Value, 16))} )
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2129 次 |
| 最近记录: |