I need to create a function that will make all uppercase characters lowercase using the charAt method. I’ve tried to use typecasting to change the int values to char but got lost after that.
/********************************************************************************
This function will calculate the integer average of characters in the array
********************************************************************************/
public static void lowerCase(char[] letter) {
char mean;
mean = (char) ((int) ch + 32);
}
Oh, actually you don’t need to check it using charAt. Just convert everything to lowercase. That will not affect the character that are already in lowercase, and convert the uppercase characters to lowercase. That’s what you need.
You don’t need to convert your
character arraytostring objectand then useString.toLowerCasemethod, because it internally usesCharacter.toLowerCasemethod only.