objective c - Putting comma between each word in NSString -
i have nsstring @"nice car" , create nsstring @"nice,car". there way this?
you use nsstring stringbyreplacingoccurrencesofstring:withstring:
method achieve follows:
nsstring *stringwithspaces = @"nice car"; nsstring *stringwithcommas = [stringwithspaces stringbyreplacingoccurrencesofstring:@" " withstring:@","];
Comments
Post a Comment