I have a string which is a 13 digit number. I need to separate all the digits and find the sum of the individual digits. How can I do that?
I converted the string to NSArray like this :
NSArray *arrStrDigits = [str13DigitNumber componentsSeparatedByString:@""];
now I want to run a loop and get something like arrStrDigits[i]
I am new to Objective C :(. Please help me out!
Get the individual digits like this:
That just needs to go in a loop where you iterate
someIndexfrom 0 to[str13DigitNumber length]