Given a word-string in Java, I want to strip off from beginning and from end, exactly these specified set of characters:
[?:!.,;'\"«»]
as many times as they appear.
For instance, «Be!!»
should become just Be
, "Here!!!"
should become Here
, «I
should become I
.
Can anyone provide a correct way to do this?