How to trim that last occurrence of a character in C#

How to trim that last occurrence of a character in C#
The below example will show you how to do that:)

  1. string str = "www.SibeeshPassion.com|";  
  2. string afterTrim = str.TrimEnd('|'); 
Here we are trimming the char '|'.