Does anyone know of an existing way to change the order of an existing NSString or NSMutableString's characters? I have a workaround in mind anyway but it would be great if there was an existing method for it.
For example, given the string @"HORSE", a method which would return @"ORSEH", @"SORHE", @"ROHES", etc?
Consider this code:
.h File:
.m File:
Not the most beautiful code or execution, but gets the job done. There's probably a (const char *) way to do this, but this works fine for me. A quick test shows a 0.001021 second length for execution on my Mac.
Usage:
Code adapted from another language / pseudocode