Prefix and suffix removal prototype