It's not trimming white space. It's removing a preceding and ending curly brace if they exist.