Java Utililty Methods Random Char

List of utility methods to do Random Char

Description

The list of methods to do Random Char are organized into topic(s).

Method

chargetRandomCharacter()
get Random Character
char c = (char) (rnd.nextInt(26) + 'a');
return c;
chargetRandomCharacter()
get Random Character
final char[] chars = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q',
        'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' };
return chars[getNextRandom(26)];
charrandomChar()
random Char
int len = uniform(0, CHARS.length);
return CHARS[len];
charrandomChar()
random Char
int num = (int) Math.floor(Math.random() * 60);
if (num < 26)
    return (char) ((int) 'a' + num);
num -= 26;
if (num < 26)
    return (char) ((int) 'A' + num);
num -= 26;
if (num < 1)
...
charrandomChar()
random Char
return (char) (int) (Math.random() * 26.0D + 97.0D);
charrandomChar()
random Char
char[] chars = { 'a', 'A', 'b', 'B', 'c', 'C', 'd', 'D', 'e', 'E', 'f', 'F', 'g', 'G', 'h', 'H', 'i', 'I',
        'j', 'J', 'k', 'K', 'l', 'L', 'm', 'M', 'n', 'N', 'o', 'O', 'p', 'P', 'q', 'Q', 'r', 'R', 's', 'S',
        't', 'T', 'u', 'U', 'v', 'V', 'w', 'W', 'x', 'X', 'y', 'Y', 'z', 'Z' };
int index = (int) (Math.random() * 52.0D) - 1;
if (index < 0) {
    index = 0;
return chars[index];
...
charrandomChar()
random Char
return alphabet.charAt(random.nextInt(alphabet.length()));
charrandomChar(char[] letters)
random Char
int index = r.nextInt(letters.length);
return letters[index];
charrandomChar(Random r)
random Char
switch (r.nextInt(101) / 100) {
case 0:
case 1:
    return (char) (32 + r.nextInt(127 - 32));
case 2:
case 3:
case 4:
case 5:
...
charrandomCharacter(boolean includeSymbols)
random Character
if (includeSymbols) {
    int ival = (int) (Math.random() * SYMBOLS_AND_CHARS.length());
    return SYMBOLS_AND_CHARS.charAt(ival);
} else {
    int ival = (int) (Math.random() * CHARS.length());
    return CHARS.charAt(ival);