开发者

How to initialize NSString as text with double quotes [duplicate]

开发者 https://www.devze.com 2023-01-05 04:15 出处:网络
This question already has answers here: 开发者_如何学JAVAIs it possible to include a quotation mark as part of an nsstring?
This question already has answers here: 开发者_如何学JAVA Is it possible to include a quotation mark as part of an nsstring? (7 answers) Closed 8 years ago.

i want to initialize NSString is as "hai" with double qoutes..is it possible? any help please? but NSString *str = @"hai"; i want to convert it as "hai" without direct initialization?any help pls?


If you want to convert an existing string please use this:

NSString *newString = [NSString stringWithFormat:@"\"%@\"",str];


NSString* foo = @"\"hai\"";

0

精彩评论

暂无评论...
验证码 换一张
取 消