Last Updated: February 25, 2016
·
686
· phaus

Map Char to Alpha Position with Java

Sometimes, you would like to have Mapping Char to Int ( A = 0, B = 1, etc.)
One easy way to do this is using indexOf

"ABCDEFGHIJKLMNOPQRSTUVWXYZ".indexOf('F')

returns 5