WWW.UnEscapeURL 解码网址
static function UnEscapeURL (s : string, e : Encoding = System.Text.Encoding.UTF8) : string
Parameters参数
- sAn url escaped string to be converted.
需要转换的一个url转义字符串,也就是一个编码过的字符串 - eThe encoding to use when converting the bytes to a character.
当转换字节到一个字符时,使用encoding,也就是编码的字符集
Returns
string - A new string with all occurrences of %xx replaced with the corresponding character.
返回string类型,一个新的字符串,其中所有的%xx都将使用对应的字符来替换。
Description描述
Decodes string from an URL-friendly format.
从一个URL格式解码字符串。
编码URL使用WWW.EscapeURL.
参考:WWW.EscapeURL.
C#
JavaScript
using UnityEngine;using System.Collections;public class example : MonoBehaviour {public void Awake() {print(WWW.UnEscapeURL("Testing%201%2C2%2C3"));}}
//This will print the string "Testing 1,2,3" to the console//这将打印出字符"Testing 1,2,3"到控制台。print(WWW.UnEscapeURL("Testing%201%2C2%2C3"));