You need to sign in to do that
Don't have an account?
Andrey Bolkonsky
converting a List of ASCII codes into the actual Integers
Another newbie quetion. I thought I was creating a List that took the value of my Integer variable "Amount" and put each digit as a value of the array. Instead I got the ASCII values! Not helpful at all.
public String writeNumber() { String amountString=String.valueOf(Amount); Len=amountString.Length(); List<Integer> arrayNumber=new List<Integer>(); for(Integer i=0; i <= Len - 1; i++) { arrayNumber.add(amountString.charAt(i)); } }If i put in 30567 for the value of Amount, I thought that {3, 0, 5, 6, 7} would be the values of my list but instead it is {51, 48, 53, 54, 55}. How can I get this to have the values that I want and not ASCII?
you can try this:
If you find this helpful, mark this as the best answer to help others.
All Answers
you can try this:
If you find this helpful, mark this as the best answer to help others.
Thanks Malika! Is there a name for this type of for loop notation style so I can learn more about it? I am only used to seeing them written like:
for( initialization; condition ; incrementation ) {};