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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started