We currently translate string.Trim only when no characters are specified (whitespace only), and implement it with LTRIM/RTRIM.
SQL Server 2017 introduced a more fully-featured TRIM function which can accept characters to trim. To maintain compatibility with older versions we can still use this only when non-whitespace characters are specified. Unfortunately no similar overloads exist for LTRIM/RTRIM (#22924).
Note that TRIM has a funky syntax (TRIM ( [ characters FROM ] string )), instead of just commas.
We currently translate string.Trim only when no characters are specified (whitespace only), and implement it with LTRIM/RTRIM.
SQL Server 2017 introduced a more fully-featured TRIM function which can accept characters to trim. To maintain compatibility with older versions we can still use this only when non-whitespace characters are specified. Unfortunately no similar overloads exist for LTRIM/RTRIM (#22924).
Note that TRIM has a funky syntax (
TRIM ( [ characters FROM ] string )), instead of just commas.