Concatenate int and string

假如想象 提交于 2019-12-17 16:53:34

问题


How can I concatenate an int (e.g: 4) and a string (e.g: @"/12") for printing?

I'm okay with casting the int it to an NSString format, but I don't know how I can add @"/12" after the int's value.


回答1:


I don't get your question, but I think you mean something like this:

...[NSString stringWithFormat:@"%d/12", intValue]


来源:https://stackoverflow.com/questions/5884367/concatenate-int-and-string

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!