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 158 views
2 answers 104 views
1 answer 243 views
1 answer 184 views
2 answers 233 views
1 answer 178 views
...