Trim spaces from prefix and suffix