Better way to replace a character in a string?
Better way to replace a character in a string?
- Subject: Better way to replace a character in a string?
- From: Tom Gray <email@hidden>
- Date: Thu, 01 Aug 2002 00:37:57 -0400
Howdy,
Thanks in advance!
Is there a better way to replace a single character in an NSMutableString
then this:
// Create an NSString from our character.
tempString = [NSString stringWithCString:&theCharacter length:1];
// Get the desired location for the character replacement.
range.location = desiredOffset;
range.length = 1;
// Replace the character in the terminal string with the new character.
[myMutableString replaceCharactersInRange:range withString:tempString];
Oh, by the way, for those of you who have been watching. I finally figured
out attributed strings. Duh. Sometimes I am really slow on the up take.
--
Tom Gray
email@hidden
or
email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.