So, what I need to do is translate an array of chars into an array of numbers.
I know this sounds like an odd request, but here's what I've been trying to do:
Have an array like this:
charArray[0] = e;
charArray[1] = b;
charArray[2] = p;
and have it translatated into:
numArray[0] = 5;
numArray[1] = 2;
numArray[2] = 16;
So it would translate the char into it's position in the alphabet (eg. "a" is the 1st letter, "b" is the 2nd, etc)
What's the best way of doing this? I was going to attempt to do it one by one, but then realized I would have way too many lines of code, it would just be tons of nested if statements, and I figured there's probably some better way to do it.
(My way was going to be if charArray[0] = a then numArray[0] = 1, and go through every single letter like that, until you get to if charArray[0] = z then numArray[0] = 26, but that would require 26 different if statements PER CHAR in the char array, which would be a horrible way of doing it in my opinion, because my char array is extremely long.)