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
Written by Philipp Haußleiter
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Java
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#