unity里做URL编码,类似java里的urlEncode,WWW.EscapeURL

WWW.EscapeURL 编码网址

static function EscapeURL (s : string, e : Encoding = System.Text.Encoding.UTF8) : string

Parameters参数

  • s
    A string to be escaped.
    一个字符串进行转义,也就是用来编码的字符串
  • e
    The encoding to use when converting characters to a character code.
    当转换字符到一个字符代码时,使用编码encoding,也就是编码的字符集
Returns

string - A new string with all illegal characters replaced with %xx where xx is the hexadecimal code for the character code.

返回string类型,一个新的字符串,用%xx替换所有非法字符,其中xx是十六进制的字符代码。

Description描述

Encodes string into an URL-friendly format.

字符串编码成一个URL的格式。

Replaces illegal characters in s with the correct URL escaped code. Useful when building web page parameters.

使用正确的URL替换非法转义代码,在建立网页时是非常有用的参数。

参考:WWW.UnEscapeURL.

// This will print the string "Testing%201%2C2%2C3" to the console
//这将打印字符串"Testing%201%2C2%2C3"到控制台
print(WWW.EscapeURL("Testing 1,2,3"));
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值