regex remove dot from end of each word in text

后端 未结 5 1660
清酒与你
清酒与你 2021-01-21 17:15

I try to remove dot only from end of each word in given text. (in java) for example:

input: java html. .net node.js php.
output: java html .net node.js php
         


        
5条回答
  •  再見小時候
    2021-01-21 17:43

    You can do:

    String repl = "java html. .net node.js php.".replaceAll("\\.(?!\\w)", "");
    
    // java html .net node.js php
    

提交回复
热议问题