how to convert indIa to INDiA using Strings


public class StringExp {

public static void main(String[] args) {


String x="indIa";
//System.out.println(x);
char ch[]=x.toUpperCase().toCharArray();

ch[3]='i';
String str=new String(ch);
System.out.println(str);

}

}

Output:

INDiA

No comments:

Post a Comment