Solution Review: Message Encryption
Have a look at the solution to the 'Message Encryption' challenge.
We'll cover the following...
Rubric criteria
Solution
Press + to interact
class RunEncryption{public static void main(String args[]){// Encrypting a StringSystem.out.println(encrypt("hefOP830nskdd0qSW uIm", '0', '.', "tuy83AB9"));}// Method to encrypt the stringpublic static String encrypt(String stringToBeEncrypted, char oldChar, char newChar, String extraString){String str = stringToBeEncrypted.toLowerCase();String update = str.substring(0, str.length()/2) + extraString + str.substring(str.length()/2);return update.replace(oldChar, newChar);}}