Please revise your display name to meet the JavaRanch Naming Policy. To maintain the friendly atmosphere here at the ranch, we like folks to use real (or at least real-looking) names, with a first and a last name.
Originally posted by ali ddd: Thanks, Actually this method is available only in JDK1.4,our application still uses the JDK 1.3 Cheers
It is actually not bad with JDK 1.3 -- instead of a one line regular expression, it could probably be done with 3 or 4 lines. (it look me only a few minutes to write the code)
With the way that you had the problem setup, the indexes can be calculated with a combinations of the indexOf() and length() methods. And the new string can be build by using the substring() methods to get the strings before and after the pattern.