简体   繁体   中英

iPhone: Convert NSString (unicode string) to char array and reverse

I have a unicode string like that @"anh sẽ đến". Now I want to cut it to a char array, and then I want to join it in one string and show it on the screen. How can I do that?

Thanks.

因为文字是对象,你可以使用[@"anh sẽ đến" UTF8String]将它转换为char数组,并使用[NSString stringWithUTF8String:]将char转换为NSString转换,但说实话,它可能更容易使用+[NSString stringWithFormat:@"anh sẽ đến%c", myUnichar]不是在字符串容器之间来回走动。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM