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 6 of 6

Thread: making a sentence proper

  1. #1
    Junior Member
    Join Date
    Feb 2010
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default making a sentence proper

    hi i hope im posting in the right part, if not, please forgive me ill make sure to post in correct part next time then.

    hi ive just started in my java class nad the teacher has required to change an input of "ThE bROwn Fox jumpS" into an output of "The Brown Fox Jumps" how do i make the first of every word capitalized when outputted?


  2. #2
    Junior Member
    Join Date
    Feb 2010
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: making a sentence proper

    ok so what i exactly have to do is take a string input of unknown word length and create an output with all of the words having the first letter capitolized.

  3. #3
    Super Moderator Json's Avatar
    Join Date
    Jul 2009
    Location
    Warrington, United Kingdom
    Posts
    1,274
    My Mood
    Happy
    Thanks
    70
    Thanked 156 Times in 152 Posts

    Default Re: making a sentence proper

    Hello there, I guess this is the wrong forums as you're not really showing us any code which you believe is broken. However I shall try to give you a little tip on how to solve this one.

    - Split the string on white space, this should give you an array of all the words in the sentence.
    - Loop through all the words and lower case them and make the first character upper case and print them out.

    Now that should get you started, its fairly easy and if you give it a shot and you still have problems, come back here and post some code and someone will point in the right direction again.

    If you dont know how to split the string or do loops, have a look at The Really Big Index

    // Json

  4. #4
    Junior Member
    Join Date
    Feb 2010
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: making a sentence proper

    may i ask what the really big index is?

  5. #5
    Super Moderator helloworld922's Avatar
    Join Date
    Jun 2009
    Posts
    2,896
    Thanks
    23
    Thanked 619 Times in 561 Posts
    Blog Entries
    18

    Default Re: making a sentence proper

    It's a link to Sun Java's tutorials on learning the Java language (hover your mouse over and click)

  6. #6
    Super Moderator Json's Avatar
    Join Date
    Jul 2009
    Location
    Warrington, United Kingdom
    Posts
    1,274
    My Mood
    Happy
    Thanks
    70
    Thanked 156 Times in 152 Posts

    Default Re: making a sentence proper

    Its Really Big

    // Json

Similar Threads

  1. Need help making program
    By ixjaybeexi in forum Collections and Generics
    Replies: 5
    Last Post: December 6th, 2009, 11:36 PM
  2. "java -version" doesn't display proper value.
    By goldest in forum Java Theory & Questions
    Replies: 6
    Last Post: November 1st, 2009, 03:48 PM
  3. reading a sentence
    By lotus in forum File I/O & Other I/O Streams
    Replies: 4
    Last Post: July 20th, 2009, 08:29 AM
  4. Digital map application with Java GUI
    By donjuan in forum AWT / Java Swing
    Replies: 3
    Last Post: May 15th, 2009, 03:32 AM
  5. Replies: 1
    Last Post: February 28th, 2009, 10:05 PM