In java there are are many methods to parse the regular expressions for example if we choose replace method provided my String class then we can just go thru this example program for rplacing the expression
this program illustrates about replacing the characters in a regular expression
so my doubt is why and when i should prefer for Pattern and matcher and and when i shoudl go for replace method of String class???
and why java provide these Matcher an Patter classes while we already have String class for replacing the characters :roll:
can any one provide me some information on this issue
thanks in advance
A = HARDWORK B = LUCK/FATE If C=(A+B) then C=SUCCESSFUL IN LIFE else C=FAILURE IN LIFE
Also note that the replace(CharSequence, CharSequence) method was only added in JDK 1.5. I suspect it was added because of all the people complaining about having to deal with regexes (or who didn't realize they were dealing with regexes) when all they wanted to do was replace a simple substring.
That which doesn't kill us makes us stronger. I think a piece of pie wouldn't kill me. Tiny ad:
how do I do my own kindle-like thing - without amazon