find and solve ||
Please wait.....

C# String PadRight()

In C#, PadRight() is a string method which is used to left-aligns the characters in String by padding them with spaces or specified character on the right, for a specified total length which method can be overloaded by passing different parameters to it.


public string PadRight(Int32 length)  

public string PadRight(Int32, Char)  


length: it is an integer type parameter.


It returns a string.

C# String PadRight() Method Example

    using System;
    public class StringPadRightExample     {
        public static void Main(string[] args)
           string str= "Hello word#";
           string str1= str.PadRight(15);



Hello word#              FindAndSolve

Related information