How to remove characters between two specific characters in a String?
Example:
Original String: "Hello <>Remove this String<> how are you?"
Modified String: "Hello <><> how are you?"
CodePudding user response:
You can use regex like this:
String result = original.replaceAll("<>.*<>", "<><>");
Output:
Hello <><> how are you?
CodePudding user response:
var result = string.replace('<>.*<>', '<><>')