I am getting Json response from server.
type = 2;
"daysofWeek" = "(\n Mon,\n Tue\n)";
serviceType = 2;
startDate = "2013-10-28";
In above format daysofWeek is Array string. I am trying to convert into NSMutableArray as
NSString *weekDaysStr=[valueDict objectForKey:@"recrWeek_daysofWeek"];
NSMutableArray *weekDays=[[NSMutableArray alloc] initWithArray:[weekDaysStr componentsSeparatedByString:@","]];
But when i log this array i shownig as
("\n Mon",
"\n Tue\n"
)
How to remove those extra words from array.
I have check each values to week day.
NSString *day=@"Mon";
if([day isEqualToString:[weekDays objectAtIndex:0]){
}
I tried this type also
weekDaysStr=[weekDaysStr stringByReplacingOccurrencesOfString:@"(\n" withString:@""];
weekDaysStr=[weekDaysStr stringByReplacingOccurrencesOfString:@"\n)" withString:@""];
weekDaysStr=[weekDaysStr stringByReplacingOccurrencesOfString:@"\n " withString:@""];
weekDaysStr=[weekDaysStr stringByReplacingOccurrencesOfString:@" " withString:@""];
weekDaysStr=[weekDaysStr stringByReplacingOccurrencesOfString:@"\"" withString:@""];
weekDaysStr=[weekDaysStr stringByReplacingOccurrencesOfString:@" " withString:@""];
it showing as
"Mon",
Tue
At that time its giving false condtion.Help me on this problem