-
How to change chars from upper to lower case
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
-
Re: How to change chars from upper to lower case
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
-
Re: How to change chars from upper to lower case
"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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks