You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Implement string.Trim with parameters on SQL Server #22927
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.
I would like to know how you expect the new TRIM function with parameters to work. Could it be easily translated to something like LTRIM(RTRIM('MyString', 'CharsToTrim'), 'CharsToTrim'), or are you expecting to use the new TRIM ( [ characters FROM ] string ) syntax?
We should definitely translate to the new SQL Server 2022 function, but the quirky syntax makes this a more difficult task. That goes beyond a beginner-level issue for sure.
Activity
maumar commentedon Oct 8, 2020
mysql has to deal with this syntax in some places, we could introduce a similar solution:
https://github.com/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql/blob/master/src/EFCore.MySql/Query/Expressions/Internal/MySqlComplexFunctionArgumentExpression.cs
roji commentedon Oct 8, 2020
Yeah, I have one too 🤣 Finally SQL Server will join the exclusive clique....
abdielcs commentedon Jun 21, 2024
I would like to know how you expect the new TRIM function with parameters to work. Could it be easily translated to something like LTRIM(RTRIM('MyString', 'CharsToTrim'), 'CharsToTrim'), or are you expecting to use the new
TRIM ( [ characters FROM ] string )syntax?roji commentedon Jun 22, 2024
We should definitely translate to the new SQL Server 2022 function, but the quirky syntax makes this a more difficult task. That goes beyond a beginner-level issue for sure.