SHARE
TWEET

Untitled

a guest Apr 21st, 2017 43 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. String cipherText =""; // for example
  2. BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(file), Charset.forName("UTF-8")));
  3. int c;
  4. while((c = reader.read()) != -1) {// read the entire file
  5.   char character = (char) c;
  6.   if (Character.isLetter(character)){ // take only the letters
  7.       cipherText+=character; // append this letter to the string
  8.   }
  9. }
  10. //finally test it
  11. System.out.println(cipherText);
  12.    
  13. cipherText = cipherText.toUpperCase();
RAW Paste Data
Top