You can use regex to change the string.
String resultString = subjectString.replaceAll("([az]+)[?:!.,;]*", "$1");
There are no words that I know about where '
is at the end, and is used as punctuation. Therefore, this regular expression will work for you.
source share