http://qs321.pair.com?node_id=7356


in reply to RE: Random letters
in thread Random letters

Several comments about this. First of all, you would need to mod random_number by 26 to make sure you get a valid letter (or 52 if you want lowercase too, the lowercase letters follow the capital ones ascii-wise). Secondly, This is not an internationally or long-term safe way of doing it, as assuming 65 is 'A' may break things for someone coming from an international character set, or if (heaven forbid) the ascii table were to change years down the line. In general, something like 'A'..'Z' is safer.