I know I can use split to take a text string and get the letter at a certain position that way, as in:
HELLO = H,E,L,L,O
position 2 = E
Is there a way to do the same with a number?
12345 = 1,2,3,4,5
position 2 = 2
(I tried using text strings for this, considered turning a number into text and then back into a number again, but that became wildly complex and I thought there must be some better way, like maybe a Haxe expression I haven’t been able to find?)
If you want to extract a letter in a word, you can split the text and put each letter into a list. Then you just use the one input on the list to get the letter you want.
For numbers, you can use the same string structure that I showed in the other post, but you use (A+"").charAt(1) to get the second position (0 is the first position).