protected static String letterify ( String letterString ) { StringBuffer sb = new StringBuffer ( ) ; for ( int i = 0 ; i < letterString . length ( ) ; i ++ ) { if ( letterString . charAt ( i ) == ' ' ) { sb . append ( ( char ) ( 97 + RandomUtils . nextInt ( 26 ) ) ) ; // a-z } else { sb . append ( letterString . charAt ( i ) ) ; } } return sb . toString ( ) ; }
Replace ? in a string with random letters