WAP to convert the alternate characters of the string to upper case . The first letter of the string has to be Capital. I/P:We are the worlD O/P: We ArE tHe WoRlD
Since the first letter is upper case, we conclude that every letter of the string at even position will be made to upper case, but since there may be spece or special characters we will have to keep that in mind also. A sample algorithm you can use is:
String x = jTextField1.getText();
len = x.length();
String otherstring;
int j=0; //to be used as counter to check alternate char
for (int i = 0;i
the characters are appended to the other string and you can display the output.