I want to replace the character ‘e’ with ‘E’ in a word “Hello”. I'm reading the arguments from the prompt.
class LowToUpCase{
public static void main(String[] args){
if (args.length != 0) {
String str = args[0];
str = str.substring(1,2);
System.out.println(str.toUpperCase());
}else{
System.out.println("Give arguments");
}
}
}
Im getting the output as the Capitalised E only. But I'm not getting any idea how to get the output as hEllo . Please give me the hint to get the needed output.