如何在iphone应用程序中拆分整数?

时间:2012-01-12 13:21:53

标签: ios4

//string convert into integer

numberIntValue=[numberId intValue];
numberIntValue=16153;

如何将此整数拆分为16153

1 个答案:

答案 0 :(得分:0)

NSInteger one=numberIntValue/1000;
NSInteger two=(numberIntValue%1000)/10;
NSInteger three=numberIntValue%10;