I'm trying to convert one element from array to upper case, but I get an error "cannot find symbol". If I don't use "toUpperCase" it works just fine and the symbol "sentence" works too.
Here's the part that doesnt work:
if (i % 3==0){
string=string+". "+toUpperCase(array[i].substring(0,1));
}
here's the whole method that works unless i put toUpperCase:
public static String sentences(String[] array){
String string="";
for (int i=0;i<array.length;i++){
if (i % 3==0){
string=string+". "+toUpperCase(array[i].substring(0,1));
}
else if (i % 3!=0){
sentence=sentence+" "+array[i];
}
}
It just finds third word in a sentence and I want to make the first letter of that third word to upper case.