iphone - How to add a word to the end of the String -


i want add words end of string. example:
have string: nsstring *str = @"http://xxxx.com/";
, after few commands want add words string , make this:

@"http://example.com/api/get_data" 

should use mutablestring?

you can create new string this:

nsstring *str = @"http://xxxx.com/"; nsstring *newstring = [str stringbyappendingstring:@"otherstring"]; 

if want add string specific string variable use nsmutablestring:

nsmutablestring *str = [nsmutablestring stringwithformat:@"http://xxxx.com/"]; [str appendstring:@"other string"]; 

Comments

Popular posts from this blog

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

javascript - addthis share facebook and google+ url -