The built-in function,
ng:trimRight()
trims any trailing blanks from a string, which is the input for the function.
Example:
This expression outputs the string: ' abc':
You can also see the difference, if you combine this function with the concat function, which concatenates multiple strings:
This expression outputs: '< abc>':

If you get the error message: "Required cardinality of first argument of <function()> is zero or one; supplied value contains <x> items", then you should refer to the suggestions here.