Results 1 to 9 of 9
  1. #1
    soni is offline Member
    Join Date
    May 2008
    Posts
    2
    Rep Power
    0

    Default string replace problem

    Hello,


    i have a string replacing word with another word,but when i do its replacing all the occurences of the word which is part of the word.

    any suggestions??

  2. #2
    rjuyal's Avatar
    rjuyal is offline Senior Member
    Join Date
    Mar 2008
    Location
    Delhi, India
    Posts
    194
    Rep Power
    7

    Default

    create your own method which take care of that!
    i am the future

  3. #3
    danielstoner's Avatar
    danielstoner is offline Senior Member
    Join Date
    Apr 2008
    Location
    Canada
    Posts
    191
    Rep Power
    7

    Default

    Or use regular expressions.
    Daniel @ [www.littletutorials.com]
    Language is froth on the surface of thought

  4. #4
    sukatoa's Avatar
    sukatoa is offline Senior Member
    Join Date
    Jan 2008
    Location
    Cebu City, Philippines
    Posts
    556
    Rep Power
    7

    Default

    Can you show us an example?

    About the input and the expected output?
    freedom exists in the world of ideas

  5. #5
    rjuyal's Avatar
    rjuyal is offline Senior Member
    Join Date
    Mar 2008
    Location
    Delhi, India
    Posts
    194
    Rep Power
    7

    Default Websense sucks

    @ DANIEL
    [Little Tutorials] is blocked by websense :(
    i am the future

  6. #6
    danielstoner's Avatar
    danielstoner is offline Senior Member
    Join Date
    Apr 2008
    Location
    Canada
    Posts
    191
    Rep Power
    7

    Default

    Yesss, my site is really dangerous, it can corrupt naive programmers :). You can always call the IT wherever you are and ask them to unblock it :)
    Daniel @ [www.littletutorials.com]
    Language is froth on the surface of thought

  7. #7
    pankaj_salwan is offline Member
    Join Date
    Jul 2008
    Location
    india
    Posts
    35
    Rep Power
    0

    Default

    can anyone guide me on it??

  8. #8
    sukatoa's Avatar
    sukatoa is offline Senior Member
    Join Date
    Jan 2008
    Location
    Cebu City, Philippines
    Posts
    556
    Rep Power
    7

    Default

    Yes, read this....
    freedom exists in the world of ideas

  9. #9
    fishtoprecords's Avatar
    fishtoprecords is offline Senior Member
    Join Date
    Jun 2008
    Posts
    571
    Rep Power
    7

    Default

    How is this considered an advanced Java question? Its basic string manipulation. Using a regex is the first example in any perl book, and at the beginning of any decent Java book.

    Can this be moved?

Similar Threads

  1. Problem with String Building
    By Albert in forum New To Java
    Replies: 2
    Last Post: 04-30-2012, 01:49 AM
  2. String and Arry Problem
    By farakhkhan@yahoo.com in forum New To Java
    Replies: 3
    Last Post: 03-31-2008, 11:17 AM
  3. Find and replace ( in a String
    By hamish10101 in forum New To Java
    Replies: 6
    Last Post: 01-17-2008, 06:51 AM
  4. problem with using string in if condition
    By sireesha in forum New To Java
    Replies: 2
    Last Post: 11-20-2007, 11:40 PM
  5. String replace method
    By venkata.tarigopula in forum Advanced Java
    Replies: 1
    Last Post: 07-10-2007, 09:14 PM

Posting Permissions

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