RTrim
Definition: Returns a copy of a string without trailing
spaces.
In VBScript the RTrimfunction is used to remove any blank spaces that appear at the end of a string; in Windows PowerShell, you can carry out this same task by using the TrimEnd() method. For example, these two commands assign a string value to the variable $a, then use the TrimEnd () method to remove the blank spaces from the end of the string (note that, for illustration purposes, we’ve used dots to represent blank spaces):