hey guys im kinda new to java n want ur help in solvin this problem :
post: all of the "letter" characters in the entered string will have been switched (lowercase to uppercase, vice versa)
i can only use for loops, character class methods, string methods
heres my code but it doesn't seem to works can u guys fix it ? thnx
public static String switchCase(String s3)
char c
{
for ( int i = 0; i == s3.length() -1; i++)
{
if (Character.isLowerCase(s3.charAt(i)) == true)
{
c = Character.toUpperCase(s3.charAt(i));
s3 = s3.replace(s3.charAt(i), c);
}
else if (Character.isUpperCase(s3.charAt(i)) == true)
{
c = Character.toLowerCase(s3.charAt(i));
s3 = s3.replace(s3.charAt(i), c);
}
}