Regular expression to remove a substring between two characters

前端 未结 3 1345
温柔的废话
温柔的废话 2021-02-13 13:25

I want to remove anything between < and > including (< and >) from my string with regular expression. Here are fe

3条回答
  •  花落未央
    2021-02-13 14:15

    Try using the regex:

    <.*?>
    

    For example:

    String s = "Hiand";
    System.out.println(s.replaceAll("<.*?>", ""));
    

提交回复
热议问题