UTF16 character in NSString
UTF16 character in NSString
- Subject: UTF16 character in NSString
- From: Ivan C Myrvold <email@hidden>
- Date: Sat, 10 Mar 2007 10:44:17 +0100
I am reading data from a SOAP webservice, where a hyphen divider is
represented as UTF16Char 32000 (decimal).
I found a way to strip those hyphen characters in NSString with this
method:
- (NSString *)stripHyph:(NSString *)str {
int i, count = 0, len = [str length];
NSMutableString *mutstr = [NSMutableString stringWithString:str];
UTF16Char hyph = 32000;
for (i=0; i<len; i++)
if ([str characterAtIndex:i] == hyph)
[mutstr replaceCharactersInRange:NSMakeRange(i + count--, 1)
withString:@""];
return mutstr;
}
But I also needs to do the other way around, and inject UTF16Char
into an NSString where I want, but I don't know how I can do that.
Can anyone give me some help here?
Ivan
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden