Question: How to check if an input string has capital letters and capitalize the corresponding letters in the output string? I currently am working on a
How to check if an input string has capital letters and capitalize the corresponding letters in the output string?
I currently am working on a java program where the user inputs a word or passage and said word or passage is translated into "pirate talk". The thing I am having trouble with is detecting when the input has a capital letter and then changing the translated word to a capital. The words for the "pirate talk" are coming from a dictionary document.
For example: when Hello! is inputted, ahoy! will output. I need it so that it can see that the "H" in Hello is capital and change it accordingly in my translation. Thanks in advance!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
