-2

I am having following NSString: 8270be11a217f1420863d76ea7d24820

and i want to convert in following format: NSData : <8270be11 a217f142 0863d76e a7d24820>

Please help!

Thanks

Tejas
  • 53
  • 1
  • 7
  • @MazIqbal That is not a duplicate of this question. – rmaddy Jan 29 '14 at 07:31
  • What exact your need, You mean in that format of string as a NSData OR encoded string as NSData.. – Kumar KL Jan 29 '14 at 07:32
  • @KumarKI : i need output as NSData which will have following output when i Print it using NSLog(@"MyData : %@,data); Output : <8270be11 a217f142 0863d76e a7d24820> – Tejas Jan 29 '14 at 07:44

1 Answers1

0

Try to do this..

   NSString* str = @"teststring";
   NSData* data = [str dataUsingEncoding:NSUTF8StringEncoding];