I need to trim whitespace (including tabs, newlines, etc.) from a string without affecting the internal whitespace. For example:
foo
bar
baz
Would become
foo
bar
baz
Of course LTRIM
/ RTRIM
won't suffice because they only remove spaces. There are a few posts here that show using the REPLACE
method to handle other characters (e.g. this one), but of course that will also remove the internal characters. I wasn't able to find an example on here to show how to remove only the leading and trailing whitespace characters from a string.