1.

Design a class in java to input a string and replace every ‘e’ with * and print the new string.

Answer»

This can help uExplanation:INPUT: str = “geeksforgeeks” Output: fbbnddvbfbbndIn the above case str = “geeksforgeeks”, the ASCII value of ‘g’ is 103 therefore ‘g’ has been replaced by moving 103 times from ‘g’ in the DESIRED range i.e., a-z. HENCE, character ‘g’ is replaced by ‘F’. SIMILARLY, the complete string “geeksforgeeks” becomes “fbbnddvbfbbnd”.Input: str = “science” Output: dxjbtxb



Discussion

No Comment Found