converting to upper case
what is the way to convert just one letter of a string to uppercase? for eg: if i have a string "welcome" and i need the output "weLcome", how can i get it?
You could use this:
public String toUpperCase(String input)
{
char[] array = input.toCharArray();
array[2] = Character.toUpperCase(array[2]);
input = new String(array);
return input;
}
The value 2 would be the position of the character which you would like to make upper case.
Message was edited by:
ita6cgr
> ... and if your name is Harry Potter, this might even> work.Give the guy a break. By the looks of his name, he's from the future, where perhaps this API call now exists :)