How to change chars from upper to lower case


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: How to change chars from upper to lower case

  1. #1
    Ken Guest

    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

  2. #2
    Paul Clapham Guest

    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




  3. #3
    Tony Guest

    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
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center