How we can remove the characters such as d, dot(.), blanks, and tab spaces at the end from the string.
Use the overloaded TrimEnd() method and pass in the character we would like to remove.
using System; public class MainClass { public static void Main(String[] argv) {//from w w w .jav a 2s . co m char[] trimCharacters = { ' ', '\t', '.', 'd' }; string blankSpaceAtEnd = "This line contains blank and tab spaces at End."; Console.WriteLine(blankSpaceAtEnd.TrimEnd(trimCharacters)); } }