First of all, show us the "Initials" variable definition, without it I can't show you specific examples.
Anyway, we also need to know what you mean with "single character to an integer". Which "character" and what does it represente for you? Is it a single digit like '2' or '3' or a binary value (e.g. from 0 to 255)?
Example, if it's a single digit you could do this:
// '0' ASCII value is 48, so this way you get the corresponding integer value
byte digit = Initials[2] - '0';
That will only work with the numeric characters, so no different then the result of toInt().
What do you really need? Generally integers are not represented by any character other than the numbers 0 to 9, unless you specify a different base such as hexidecimal.
i often process single character cmds prefixed with numeric a argument
static int val = 0;
if (Serial.available()) {
int c = Serial.read ();
switch (c) {
case '0'...'9':
val = c - '0' + (10 * val);
break;
case 'A':
analogPin = val;
Serial.print ("analogPin = ");
Serial.println (val);
val = 0;
break;
case 'D':
debug ^= 1;
break;
Sorry, I'm still a bit confused about your requirement.
I see an array of 3 String elements here, so please give me an example of the possible values you have for "Initials" and what you intend to obtain with them, and then we'll see...
If you can provide an example, as I asked, of the strings or characters you have in that array and what you want to get, I can try to help. If you're so vague, you'll only get vague answers.
So since it doesn't seem like a complicated question, I'll ask again: can you show an example of what you have in the array and what you want to get from each element?
I agree 100%. But unless the post author can demonstrate their goals, possibly with an example, I think it's best to avoid filling the discussion with general principles (even if they're absolutely correct!).
The OP should do their part and make an effort to better describe what they have and what they want to achieve. I'd avoid giving further answers before this.
1
In C++ language when it is said charcater, I understand one of the following what is called a Character Set: A to Z a to z 0 to 9 Punctuation marks
`Any prinable control characters'
2.
In C++ language when it is said integer, I understand one of the following: 0, 1, .......................... all interger numbers that memory can hold
3.
During runtime, all symbols are stored as numerical numbers (0 and 1) inside computer memory and register. That's why the alphabets of the Character Set are assigned numerical values like: 0101 0001 (0x41) for A and so on...
4.
So, a character is not an integer; but, it has an integer value. The declarations are also different:
char ch = 'A`; //ch olds a character which has an integer value of 0x41
byte data = 0x41; //data holds an integer value
5.
Serial.print(ch); //shows A
Serial.print(data); //shows: 65