• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
UTF16 character in NSString
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: UTF16 character in NSString
      • From: Shawn Erickson <email@hidden>
  • Prev by Date: Re: Undefined symbols in release build
  • Next by Date: NSMenuItem events
  • Previous by thread: Re: Undefined symbols in release build
  • Next by thread: Re: UTF16 character in NSString
  • Index(es):
    • Date
    • Thread