All
I am looking to format a guid stored in an NSString with hyphens? I would like to avoid substrings and use a formatter if possible
so
D21AB2C8-E61F-11E0-ADEE-20D04824019B
instead of
D21AB2C8E61F11E0ADEE20D04824019B
The value is already in an NSString and I just need to add the hyphens, but I would rather not have to deal with parsing the String and inserting hyphens with substrings.
Any thoughts?
Thanks!
Not sure why you are against parsing, but if you are so dead set against it then use an NSMutableString and insert your hyphens at the appropriate index.
For the record, I think its better to use NSString’s stringWithFormat and substrings, but to each his own.