iphone - Get one by one character (value) from NSString -


i have nsstring in store value 2534568

i want first number 2 , 5 ,

then 3 , on.....

thanks advance

since no correct answer has been provided far, must answer if didn't otherwise. don't want misleaded:

nsuinteger len = string.length; unichar buf[len]; [string getcharacters:buf range:nsmakerange(0, len)]; 

here, buf contain characters can iterate through. alternatively, can use charateratindex: method too, although i'm not sure that's not slower plain array indexing. (thus should benchmarked if it's bottleneck, don't perform premature optimization, though.)


Comments

Popular posts from this blog

python - cx_oracle unable to find Oracle Client -

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -