![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
C# String.PadRight Method
Pad the end of the string with spaces using the PadRight() method. You can also pad it with a Unicode character.
Let’s say the following is our string.
string myStr = "Text1";
To set a padding at the end of the above string, use the PadRight method.
myStr.PadRight(10);
Here is the complete example.
Example
using System; class Demo { static void Main() { string myStr = "Text1"; // set padding at the end Console.Write(myStr.PadRight(10)); Console.WriteLine("Text2"); } }
Output
Text1 Text2
Advertisements