All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.swiftboot.sheet.util.LetterUtils Maven / Gradle / Ivy

There is a newer version: 2.4.7
Show newest version
package org.swiftboot.sheet.util;

/**
 * @author swiftech
 */
public class LetterUtils {


    /**
     * Convert a letter (ignore case) to index in [A-Z].
     *
     * @param letter
     * @return
     */
    public static int letterToIndex(char letter) {
        return Character.toUpperCase(letter) - 'A';
    }

    /**
     * Convert number in alphabet to a letter (upper case)
     *
     * @param num
     * @return
     */
    public static char numberToLetter(int num) {
        return (char) ('A' + num - 1);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy