DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

PadLeft() Of String

03.27.2012
| 3432 views |
  • submit to reddit
        PadLeft function of string


            Console.WriteLine("Preceeded By Ten underscore".PadLeft(10, '_')); // Write ten underscore 
	    Console.WriteLine("Preceeded By 5 comma".PadLeft(10,',')); // Write ten characters with comma
__________Preceeded By Ten underscore
,,,,,,,,,,Preceeded By 5 comma