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

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -