Java tutorial
//package com.java2s; public class Main { public static String randomStr(long strLen) { char freshChar; String freshString; freshString = ""; while (freshString.length() < (strLen - 1)) { freshChar = (char) (Math.random() * 128); if (Character.isLetter(freshChar)) { freshString += freshChar; } } return (freshString); } }