Results 1 to 3 of 3
  1. #1
    JordashTalon is offline Member
    Join Date
    Jan 2009
    Posts
    37
    Rep Power
    0

    Default Output correct grammar

    I have a string like this:

    "this is a cool string . and another cool segment of the same string . "

    As you can see the periods have an extra space I need to change that too:

    "this is a cool string. and another cool segment of the same string."

    I tried

    String=String.replaceAll(" . ", ". ");

    But that doesn't work it also replaces all the a's in the string, not sure why, I think it has something to do with the Hex values or something like that or I need to use Regular Expressions.

    Any help would be appreciated.

    Thanks

  2. #2
    angryboy's Avatar
    angryboy is offline Senior Member
    Join Date
    Jan 2009
    Posts
    742
    Rep Power
    6

    Default

    why not reply to your other post first before starting a new one? Have a period in string, how to make it look nicer
    USE CODE TAGS--> [CODE]...[/CODE]
    Get NotePad++ (free)

  3. #3
    JordashTalon is offline Member
    Join Date
    Jan 2009
    Posts
    37
    Rep Power
    0

    Default

    oh sorry didn't notice the updates on the other thread, my bad. your other post worked, you are a regular expression genius!

Similar Threads

  1. Java, output string, getting correct output? HELP!
    By computerboyo in forum New To Java
    Replies: 2
    Last Post: 02-25-2009, 11:44 PM
  2. Please suggest me the correct approach!
    By rjuyal in forum Advanced Java
    Replies: 6
    Last Post: 05-05-2008, 02:54 PM
  3. Is my Pseudocode correct?
    By Clemenza1983 in forum New To Java
    Replies: 0
    Last Post: 01-29-2008, 04:07 AM
  4. To correct forum
    By Jman in forum Introductions
    Replies: 3
    Last Post: 01-18-2008, 02:33 AM
  5. Correct Number formatting
    By paul in forum New To Java
    Replies: 1
    Last Post: 08-07-2007, 04:59 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •