I get the response from service url and I took them into array.I have the objects in this array with todays week day.But while doing so I get commas from service.So I need to remove the commas from them and compare.How can I do it?
array3:
(
{
Code = "Sunday,";
},
{
Code = "Thursday,";
},
{
Code = "Friday,";
},
{
Code = "Saturday,";
}
)
To compare:
NSMutableArray *yourArray = [[NSMutableArray alloc] init];
for (NSDictionary *dict in array3) {
[yourArray addObject:[dict valueForKey:@"Code"]];
}
BOOL isTheObjectThere = [yourArray containsObject:@"Thursday"];
But I get isTheObjectThere as 'NO' because yourArray is like:
(
Sunday,,
Thursday,,
Friday,,
Saturday,
)
So how can I remove that extra comma when there are two commas and compare: