add different characters to a NSString one by one??

Posted by hemant on Stack Overflow See other posts from Stack Overflow or by hemant
Published on 2010-04-23T09:05:31Z Indexed on 2010/04/23 9:13 UTC
Read the original article Hit count: 199

Filed under:
|

i am retrieving different characters from a string by using thsi function and adding 5 to them to display the corresponding character for eg. 'a' displays 'f' and 'h' displays 'm'.. but the problem is that i am not able to add these characters into a string which i can use to display to display like 'fm'...can anyone help?? heres the code strResult(mutablestring) is getting null only.

`str=@"John";

int a=[str length];

for(i=0;i

char ch=[str characterAtIndex:i];

ch=ch+5;

temp=[NSString stringWithFormat:@"%c",ch];

[strResult appendString:temp];

NSLog(@"%c",ch);

}`

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about iphone-sdk