What does this line return for i = 1?
String alph = alphabet.substring(i, i + 1);
When you enter the else (i.e. sentence.indexOf(alph) == -1) you don't need to continue your loop.
And you...
Type: Posts; User: PhHein
What does this line return for i = 1?
String alph = alphabet.substring(i, i + 1);
When you enter the else (i.e. sentence.indexOf(alph) == -1) you don't need to continue your loop.
And you...
Firstly, never ever code if elses without braces, even if they only contain one line of code. Secondly think ASCII. convert the entered sentence to lower case and use nested loops to iterate over the...