Advertisement
Guest User

Untitled

a guest
Apr 21st, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  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();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement