如何将ascii代码更改为字符?

时间:2014-01-30 06:43:42

标签: ios iphone ios5

如何将ASCII码更改为字符?比如'@#32'到'space'和'@#46'到'fullstops(。)'。我

从服务中获取这些数字,我需要将它们转换为字符。

但我从服务器获取大量数据,这些数据包括'&#13'等数字

中的字符。不知道如何摆脱所有这些条款。

当我使用下面的代码时,它不起作用..

NSCharacterSet *notAllowedChars = [[NSCharacterSet characterSetWithCharactersInString:@"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"] invertedSet];
NSString *resultString = [[description componentsSeparatedByCharactersInSet:notAllowedChars] componentsJoinedByString:@""];

0 个答案:

没有答案