Skip to content

Philipps Blog

my personal Site of Things

  • About
  • Friends
  • Home
  • About

Tag: mapping

Map Char to Alpha Position with Java

2016-02-252024-02-09 PhilippLeave a comment
brown scrabble boards with letters

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

Posted in CoderwallTagged char, coderwall, integer, java, mapping
Proudly powered by WordPress | Theme: Libre 2 by Automattic.
 

Loading Comments...