padleft

Can't figure out what this SubString.PadLeft is doing.

In this code I am debugging, I have this code snipit: ddlExpYear.SelectedItem.Value.Substring(2).PadLeft(2, '0'); What does this return? I really can't run this too much as it is part of a live credit card application. The DropDownList as you could imagine from the name contains the 4-digit year. UPDATE: Thanks everyone. I don't do a...

How do I pass a String into a function in an NVelocity Template?

I'm using the NVelocity Templating engine to produce a fixed-length field output - you know the kind of thing: Field Start Pos Field Length Notes ---------- --------- ------------ --------- Supplier 1 7 Leading Zeros GRN 8 9 - ... e.g. >0001234 123A< The probl...

.NET My.Computer.Network.Ping & PadLeft

Following code snippet throws an error when padding the last part with 0, and the last part is 008, 009, 018, 019, 028, 029 etc. Anyone got an idea why? Sub Main() Dim fixed As String = "192.168.0." Dim ip1, ip2 As String For i As Int32 = 1 To 255 ip1 = fixed & Convert.ToString(i) Console.Write(ip1 & " - ") ...