String Builder C#

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ashes Csharp
    New Member
    • Sep 2011
    • 1

    String Builder C#

    I have a stringbuilder which contains a string. I need to check last three character of the string in string builder and remove the last three character if it matches the condition.
  • snehasismishra1
    New Member
    • Aug 2011
    • 18

    #2
    Find the below code:

    Code:
     StringBuilder builder = new StringBuilder("DotNetQuestion");
           if (Conditin)
           {
              int len = builder.Length;
              builder.Remove(len - 3, 3);
              Console.WriteLine(builder);
              Console.ReadLine();
            }
    Thanks,
    Snehasis

    Comment

    Working...