use the TrimEnd() method with an argument to remove specific characters from the end of a string.
the TrimEnd() method is used with an array of characters to remove the '=' and '!' characters from the end of the string str. The resulting output is the trimmed string, without any '=' or '!' characters at the end.