Question What does {0,-30} do in string formatting?

groadsvb

Well-known member
Joined
Nov 13, 2006
Messages
75
Programming Experience
Beginner
I have been reading walls of text to try to find out what the -30 is in this format that I got off the internet. It works but I really want to understand what I am doing. the format string is {0,-30}{1:yyyy-MM-dd HH:mm}. Can someone tell me what the -30 does? Also if you have a link to a site that helps understand I would appreciate it very much. Thanks.
 
String.Format Method (System)
alignment
Optional. A signed integer that indicates the total length of the field into which the argument is inserted and whether it is right-aligned (a positive integer) or left-aligned (a negative integer). If you omit alignment, the string representation of the corresponding argument is inserted in a field with no leading or trailing spaces.
 
The link that JohnH provided is to the MSDN Library documentation. You can access that same documentation using the Help menu in Visual Studio. As someone who wants to build software, you really should be familiar with using software sufficiently that you know to use the Help menu to find help. As a .NET developer, the MSDN Library should always be your first port of call when you need help. If you can't find what you need or don't understand what you find, that's when you should use forums like this one.
 
Back
Top