You could use
str.charAt(0)
where the argument, in this case, ‘0’, is the character of the string you want to look at. So something like this:
str = text.sourceText;
firstLetter = str.charAt(0);
if (firstLetter === "A") {
[0,100]
} else if (firstLetter === "B") {
[0,200]
}
If you wanted to do it programmatically, perhaps something like this would work:
str = text.sourceText;
firstLetter = str.charAt(0);
letters = ["A","B","C","D","E","F","G","H"];
for (i = 0; i < letters.length; i++) {
if (firstLetter === letters[i]) {
y = (i+1) * 100;
break;
}
}
[0,y];