I am displaying text on a UILABEL from XML, I am getting CRLF's in the text.So i am not able to append the new lines for my label.This is the code i tried.But iam not getting PLease help me in this
NSArray* array = [subHead.Description componentsSeparatedByString:@"\r\n"]; NSLog(@"Count : %d",[array count]); for(int i=0;i<[array count];i++) { NSLog(@"%@",[array objectAtIndex:i]); NSString* s = [NSString stringWithFormat:@"%@",[array objectAtIndex:i]]; // s = [s stringByTrimmingCharactersInSet:[NSCharacterSet controlCharacterSet]]; if ([s length]>0){ [str appendString:[array objectAtIndex:i]]; [str appendString:@"\r\n"];flag++; }else { NSLog(@"Two \n\'s are occured"); } NSLog(@"Flag value : %d",flag); } NSLog(@"String : %@",str); NSLog(@"Description : %@",subHead.Description); subheadlabel.text=str; THANKS IN ADVANCE