Hi,
Does anyone know of a method that changes characters from upper to lower
case or vice vera and the import statement necessary to make it work?
Thanks,
Ken
Printable View
Hi,
Does anyone know of a method that changes characters from upper to lower
case or vice vera and the import statement necessary to make it work?
Thanks,
Ken
They would be toUpperCase() and toLowerCase(). You don't need any import
statements to use methods of java.lang.String because all classes in
java.lang are automatically imported to any program you write.
Example:
String a = "Hello, world.";
String b = a.toUpperCase();
Resulting string b contains "HELLO, WORLD."
Ken <ken_xxx@hotmail.com> wrote in message news:3964e3cf$1@news.devx.com...
>
> Hi,
>
> Does anyone know of a method that changes characters from upper to lower
> case or vice vera and the import statement necessary to make it work?
>
> Thanks,
>
> Ken
"Ken" <ken_xxx@hotmail.com> wrote:
>
>Hi,
>
>Does anyone know of a method that changes characters from upper to lower
>case or vice vera and the import statement necessary to make it work?
>
>Thanks,
>
>Ken
Use the Character class methods toUpperCase(char ) and toLowerCase(char ).
"Import java.lang.Character" is used to import the class.