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
Post a Comment