I have a NSString object “testtimeFrame” which i am converting to NSMutableString object “mutable” and doing insertStringAtIndex method..
my testtimeframe value is 05-8-2012 and i want to insert “0” before 8 but it’s showing it as 80 instead of 08..
NSMutableString * mutable = [NSMutableString stringWithString:testtimeFrame];
[mutable insertString:@"0" atIndex:3];
NSLog(@"my day is:%@",mutable);
Thanks
Yes, that is correct behavior. Remember that index always starts at 0!
So your code is fine! I’ve just run:
And it works great!
You probably have a problem with:
testtimeframe