public String random ( int count , final char [ ] chars ) { if ( count == 0 ) { return StringPool . EMPTY ; } final char [ ] result = new char [ count ] ; while ( count -- > 0 ) { result [ count ] = chars [ rnd . nextInt ( chars . length ) ] ; } return new String ( result ) ; }
Creates random string whose length is the number of characters specified . Characters are chosen from the set of characters specified .