开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜