Java String to convertString(char firstCharacter, String value)

Here you can find the source of convertString(char firstCharacter, String value)

Description

convert String

License

BSD License

Declaration

private static int convertString(char firstCharacter, String value) 

Method Source Code

//package com.java2s;
/*L//from w w w  .  j a  v  a  2 s.co m
 * Copyright Moxie Informatics.
 *
 * Distributed under the OSI-approved BSD 3-Clause License.
 * See http://ncip.github.com/calims/LICENSE.txt for details.
 */

public class Main {
    private static final int LETTER_BASE = 26;

    private static int convertString(char firstCharacter, String value) {
        int result = 0;
        for (int i = 0; i < value.length(); i++) {
            result = result * LETTER_BASE + value.charAt(i) - firstCharacter;
        }
        return result;
    }
}

Related

  1. convertString(Object obj, String nullTo)
  2. convertString(String label)
  3. convertString(String s)
  4. convertString(String s, Class cls)