我需要删除一个单词后的标点符号.例如,word?!应该更改为word,string:应该更改为string.
word?!
word
string:
string
编辑:算法应该只删除字符串末尾的标点符号.字符串中的任何标点都应该保留.例如,doesn't;应该成为doesn't.
doesn't;
doesn't
java string
java ×1
string ×1