开发者

How to extract only date from full date (2011-05-15) and store in array in iphone

开发者 https://www.devze.com 2023-03-15 07:47 出处:网络
Full date string 2011-05-15, 2011-05-17, 2011-05-18, 2011-05-20, are comes from server i want to extra开发者_如何学Pythonct only Day value (15,17,18,20..etc) and store it in ur local Array

Full date string 2011-05-15, 2011-05-17, 2011-05-18, 2011-05-20, are comes from server i want to extra开发者_如何学Pythonct only Day value (15,17,18,20..etc) and store it in ur local Array and show these days(these are Events days) in calendar with red color. how can i do this. Please any one give me idea.

Thanks in Advance :)


The following block should help you

NSMutableArray *arr=[[NSMutableArray alloc] init];

for(NSString *date in [@"2011-05-15, 2011-05-17, 2011-05-18, 2011-05-20" componentsSeperatedByString:@","])
{
    NSString *day=[[date componentsSeperatedByString:@"-"] objectAtIndex:2];
    [arr addObject:day];
}
0

精彩评论

暂无评论...
验证码 换一张
取 消