How to pad the beginning of a string with spaces in C#

1 Answer

0 votes
using System;

class Program
{
    static void Main() {
        string s = "c# pro";
        
        Console.WriteLine(s.PadLeft(17)); 
    }
}
 
 
 
 
/*
run:
 
           c# pro
 
*/

 



answered Nov 19, 2021 by avibootz

Related questions

1 answer 224 views
1 answer 154 views
1 answer 156 views
2 answers 263 views
1 answer 166 views
1 answer 163 views
1 answer 158 views
...