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?"
Advertisement
Answer
You can use regex like this:
String result = original.replaceAll("<>.*<>", "<><>");
Output:
Hello <><> how are you?