I have generated a constant by regex alled punctuation that contains everything that is defined to be punctuation i.e.
PUNCTUATION = " !\"',;:.-_?)([]<>*#\n\t\r"
Only problem is that I am not sure how to use this to remove all leading and trailing punctuation from a specified word. I have tried methods like replaceAll
and startsWith
but have had no luck.
Any suggestions anyone?