Reputation: 60869
I would like to separate my string by spaces, commas, periods (ie. punctuations). I am using:
[myString componentsSeparatedByString:@" "];
to separate by spaces, but need to be able to split by punctuations as well.
Upvotes: 2
Views: 3090
Reputation: 237010
Use componentsSeparatedByCharactersInSet:
with a character set made up of whatever characters you want to split by.
Upvotes: 5