Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 5 of 5

Thread: How do you change the case of a letter?

  1. #1
    Junior Member
    Join Date
    Oct 2011
    Posts
    10
    My Mood
    Stressed
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How do you change the case of a letter?

    I'm trying to change the case of every letter.


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: How do you change the case of a letter?

    You will have to look at the letters one at a time, determine its case and set its case to the new case.
    Look at the Character class for useful methods.

  3. #3
    Junior Member
    Join Date
    Oct 2011
    Posts
    10
    My Mood
    Stressed
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: How do you change the case of a letter?

    Quote Originally Posted by Norm View Post
    You will have to look at the letters one at a time, determine its case and set its case to the new case.
    Look at the Character class for useful methods.
    The string will be a user input

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: How do you change the case of a letter?

    Once you have the characters in a String, the source of the data won't change how you process it.

  5. #5
    Forum VIP
    Join Date
    Oct 2010
    Posts
    275
    My Mood
    Cool
    Thanks
    32
    Thanked 54 Times in 47 Posts
    Blog Entries
    2

    Default Re: How do you change the case of a letter?

    To change all letters to capital or lowercase, there are some methods in the String API, but it will change every letter in the String. Look at the String API if that is alright:

    String (Java Platform SE 6)

Similar Threads

  1. Case Switch Help?
    By xionyus in forum What's Wrong With My Code?
    Replies: 17
    Last Post: October 19th, 2011, 08:59 PM
  2. letter pattern
    By severus1 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: July 4th, 2011, 01:24 PM
  3. orphaned case
    By frozen java in forum What's Wrong With My Code?
    Replies: 3
    Last Post: April 5th, 2011, 08:35 PM
  4. CompareToIngnore case problem
    By newTaz in forum What's Wrong With My Code?
    Replies: 9
    Last Post: November 7th, 2010, 05:28 PM
  5. [SOLVED] upper case
    By andaji in forum What's Wrong With My Code?
    Replies: 2
    Last Post: March 13th, 2010, 11:54 PM