Allocate a buffer of unichar. Copy into the buffer w/ getCharacters(range:). Manipulate. Convert back using init(charactersNoCopy:length:freeWhenDone:).

unichar is UTF-16. If you're willing to assume that nothing require surrogate characters (for example, if you assume it's ASCII), then you can just allocate your buffer based on length (it'll be 2 * length). If you want to be more flexible, but still O(1) at the cost of 2-3x memory requirement, then use maximumLengthOfBytes. If you want to be more flexible, but are willing to accept an O(n) step (I assume you aren't), then use lengthOfBytes.

It is somewhat common for NSString to be stored internally as UTF-16, so this tends to be a very fast conversion. That said, if you have enough knowledge about your strings, and are willing to write additional code to manipulate encodings directly, then look at fastestEncoding.