NSString *firstName=@"Manoj";
NSString *lastName=@"Yadav";
NSString *fullName = [NSString stringWithFormat:@"%@ %@",firstName,lastName];
//OutPut >> Rajneesh Tailor
NSString *fullName2 =[firstName stringByAppendingString:lastName];
//OutPut >> ManojYadav
(if you don't want space between both)
Component Separate by String
NSString *string = @"Manoj,Iphone Developer";
NSArray *separateStringsAry = [string componentsSeparatedByString:@","];
NSLog(@"%@",[separateStringsAry objectAtIndex:0]); //OutPut : Manoj
NSLog(@"%@",[separateStringsAry objectAtIndex:1]); //OutPut : Iphone Developer
No comments:
Post a Comment