Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public boolean toggleEncryption(){
- if(encrypted == false){
- for(int i = 0; i < sentence.length(); i++){
- if(sentence.charAt(i) >= 65 && sentence.charAt(i) <= 90){
- int x = (int)sentence.charAt(i);
- x += key;
- while(x > 90){
- x = x - 26;
- }
- sentence.charAt(i) += (char)x;
- }
- }
- }
- return encrypted;
- }
- sentence.charAt(i) += (char)x;
- char c = 'a';
- c += 'b';
- StringBuilder builder = new StringBuilder(sentence.length());
- for(int i = 0; i < sentence.length(); i++) {
- if(sentence.charAt(i) >= 65 && sentence.charAt(i) <= 90){
- int x = (int)sentence.charAt(i);
- x += key;
- while(x > 90){
- x = x - 26;
- }
- builder.append(sentence.charAt(i) + (char)x));
- } else {
- builder.append(sentence.charAt(i));
- }
- }
- sentence.charAt(i) += (char)x;
- char tempChar = sentence.charAt(i);
- tempChar += (char)x;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement