How to remove white spaces from starting of a string in C#

1 Answer

0 votes
using System;

class Program
{
    static void Main() {
        string s = "    c# programming";

        s = s.TrimStart();
        
        Console.Write(s);
    }
}




/*
run:
 
c# programming
 
*/

 



answered Nov 14, 2021 by avibootz

Related questions

1 answer 144 views
2 answers 89 views
1 answer 223 views
1 answer 170 views
2 answers 210 views
1 answer 162 views
...