968970 wrote:I wouldn't be so sure about it. It might be shorter, but not necessary cleaner.
i think using replaceAll will be much cleaner.
968970 wrote:See, you're getting there. You already have one case dealt with. You could use the or operator to match the rest of the cases.
And if i am using the regex below
String str = "abc*def*";
String str1 = str.replaceAll(".[*].", "");
Then I am getting the string result as abef* but i want abe.