This week's giveaways are in the MongoDB and Jobs Discussion forums. We're giving away four copies of Mongo DB Applied Patterns and 4 resume reviews from Five Year Itch and have the authors/reps on-line! See this thread and this one for details.
Without you posting the exact String you want to replace, I can only assume the somehow fall into a Regular expression and it's inappropriate. I suggest you look at java.util.regex.Pattern to determine the correct pattern to use to find what needs replaced.
i was using string.replaceFirst(String,String) but it didnt work in my company where i am working.
what might be the problem
Since I have no trouble with the method I assume you have a bug in your code. Note - Strings are immutable so the original string is not modified and the method returns a new String. If this is not the problem then I bet you have a fault in your regular expression.
Of course, it would be easier for the forum members to diagnose the problem if you posted your code.
Retired horse trader.
Note: double-underline links may be advertisements automatically added by this site and are probably not endorsed by me.
Joined: May 13, 2010
i was calling replace.First() method because i wanted to replace each occurrence of String to be replace and recorded