TRIM() function is introduced in SQL Server 2017. In all the previous versions, we have only LTRIM() to remove the leading spaces from the string and RTRIM() to remove the trailing spaces. The newly introduced function can be used to remove the unwanted leading and trailing spaces from a string in one go. It can also be used to remove characters other than space from the beginning and ending of the string.
I had the same issue messing with BPMs, thought I would test even though I am still on SQL 2016. Guess when they meant certified only with 2017 or 2019 they really meant it this time