DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Robert has posted 10 posts at DZone. View Full User Profile

URLEncode A String

09.04.2008
| 649 views |
  • submit to reddit
        // how to URL encode a string

NSString *orig = @"i am not & url / safe";
NSString *urlEncoded = [orig stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding];