美文网首页
stringByAddingPercentEncodingWit

stringByAddingPercentEncodingWit

作者: YYT1992 | 来源:发表于2016-05-10 16:46 被阅读321次

To escape character use stringByAddingPercentEncodingWithAllowedCharacters:

NSString *URLEscapedString =

[string stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];

The following are useful character sets:

URLFragmentAllowedCharacterSet  "#%<>[\]^`{|}

URLHostAllowedCharacterSet      "#%/<>?@\^`{|}

URLPasswordAllowedCharacterSet  "#%/:<>?@[\]^`{|}

URLPathAllowedCharacterSet      "#%;<>?[\]^`{|}

URLQueryAllowedCharacterSet    "#%<>[\]^`{|}

URLUserAllowedCharacterSet      "#%/:<>?@[\]^`

相关文章

网友评论

      本文标题:stringByAddingPercentEncodingWit

      本文链接:https://www.haomeiwen.com/subject/zueyrttx.html