Here you can find the source of intToChar(int i)
Parameter | Description |
---|---|
i | a parameter |
public static char intToChar(int i)
//package com.java2s; //License from project: Academic Free License public class Main { public static final char PAD_CHAR = '='; /**/*w w w . j a v a 2s . co m*/ * Converts number to character. * * @param i * @return */ public static char intToChar(int i) { char c = PAD_CHAR; if (i >= 0) { if (i < 26) { c = (char) ('A' + i); } else if (i < 52) { c = (char) ('a' + i - 26); } else if (i < 62) { c = (char) ('0' + i - 52); } else if (i == 62) { c = '+'; } else if (i == 63) { c = '/'; } } return c; } }