Quote:
Originally Posted by korki696
Hey all,
I am working on a program and im sure what I need to do is fairly simple but I just cant figure it out. What I need to do is take an array i have that is full of numbers and then every 2 numbers I have to add a 0. For example:
Original:
5555555555555555
What I need:
550550550550550550550550
How could I do this?
Thanks
-Korki
|
Code:
for(int x=2;x<[arrayName count];x+=3) {
[arrayName insertObject:[NSNumber numberWithInt:0] atIndex:x];
}
Granted, I've been developing for a few months and could be well off. Worth a try, I guess? Let me know how it goes.
edit: this is assuming you're using an NSMutableArray, didn't occur to me you could be using something else