How to map character to numeric position in java?

Posted by Alex on Stack Overflow See other posts from Stack Overflow or by Alex
Published on 2010-04-02T01:01:26Z Indexed on 2010/04/02 1:03 UTC
Read the original article Hit count: 286

Filed under:

E.g.

  • input: ['A', 'Z', 'F', 'D', ...]
  • output: [0, 25, 5, 3, ...]

In C I'd just subtract the char from 'A', but I don't seem to be able to do this in java.

© Stack Overflow or respective owner

Related posts about java