Share

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

Original Post: https://coderwall.com/p/ql-wng/map-char-to-alpha-position-with-java

You may also like...

Leave a Reply