Version: v0.8.1 - Beta.  We welcome contributors & feedback.

String.removeWrap

removeWrap($prefix, $suffix) -> string

Description

Remove $prefix and $suffix from the beginning and end of the string, if both exist.

'(ACCEPTED)'.removeWrap('(', ')')
//= 'ACCEPTED'

'ACCEPTED'.removeWrap('(', ')')
//= 'ACCEPTED'

See Also