Convert NSString to NSData

//eg: 7 days before
NSString* str = @"teststring";
NSData* data = [str dataUsingEncoding:NSUTF8StringEncoding];

Replace chars within a string

NSString *str = @"This is a string";
str = [str stringByReplacingOccurrencesOfString:@"string"
                                     withString:@"duck"];

results matching ""

    No results matching ""