开发者

iphone variable in NSString

开发者 https://www.devze.com 2023-01-07 04:28 出处:网络
I need to define a string that will include a string that changes (i can already make that string change) and additional text.

I need to define a string that will include a string that changes (i can already make that string change) and additional text.

开发者_如何学运维

for example,

NSString *commentsAddress = *somestring*/#comments;

now i know it sould be something more along the lines of

NSString *commentsAddress = @"%@/#comments", *somestring*;

but I can't get this to work.


NSString *comment = @"This is the comment";
NSString *commentAddress = [NSString stringWithFormat: @"%@/#comments", comment];
0

精彩评论

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