use the Trim(), TrimStart(), and TrimEnd() methods to trim strings : String : Data Types C# Source Code


Custom Search

C# Source Code » Data Types » String »

 

use the Trim(), TrimStart(), and TrimEnd() methods to trim strings








    
 

using System;

class MainClass {

    public static void Main() {

        string myString18 = '(' +"  Whitespace  ".Trim() + ')';
        Console.WriteLine("'(' +\"  Whitespace  \".Trim() + ')' = " + myString18);
        string myString19 = '(' + "  Whitespace  ".TrimStart() + ')';
        Console.WriteLine("'(' +\"  Whitespace  \".TrimStart() + ')' = " + myString19);
        string myString20 = '(' + "  Whitespace  ".TrimEnd() + ')';
        Console.WriteLine("'(' +\"  Whitespace  \".TrimEnd() + ')' = " + myString20);

    
    }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Data Types
» String