Originally posted by Rob Lord:
Hello
I am relatively new to Java and J2EE, and have programmed a banking web application at work.
However, there is an algorithm I need to program and it involves breaking a number down to do calculations on the individual numbers that make it up.
The number will be about 14 digits long max, but I was wondering what the best way to break the number down in java is (ie the number 123456789 will need to have the last two digits added to the fifth digit etc).
Any advice will be appreciated.
Rob.
Dear Rob,
What are you looking for I can illustrate you for an example:
if you have any digit e.g 1245364
then you need every digit seperately like
4
6
3
5
4
2
1
This is an example. If you would like to this one only... Then it quite easy.
I can show you a code snippet
This would create following output according to the input
"123234"
a[0]=4
a[1]=3
a[2]=2
a[3]=3
a[4]=2
a[5]=1
Hope your problem has been covered in this logic...
If still any concern then revert with concerns.