我需要删除一个单词后的标点符号.例如,word?!应该更改为word,string:应该更改为string.
word?!
word
string:
string
编辑:算法应该只删除字符串末尾的标点符号.字符串中的任何标点都应该保留.例如,doesn't;应该成为doesn't.
doesn't;
doesn't
java string
我想知道诸如"equi-distant"或"they are"之类的字符串是否包含非单词字符.有没有一种简单的方法来检查它?
java ×2
string ×2