Design a class in java to input a string and replace every ‘e’ with * and print the new string.
Answers
Answered by
0
Answer:
This can help u
Explanation:
Input: str = “geeksforgeeks”
Output: fbbnddvbfbbnd
In 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
Similar questions