Frederick Douglass taught that literacy is the path from slavery to freedom. There are many kinds of slavery and many kinds of freedom, but reading is still the path.
I am building a Diner POS (practice project) and needed a fixed length string for the customer receipt (since product names are of variable lengths). Thought I'd share the code I found with you guys :)
Public Function FixedLengthString(ByVal value As String, ByVal totalLength As Integer, ByVal padding As Char) As String
Dim length = value.Length
If (length > totalLength) Then Return value.Substring(0, totalLength) Return value.PadRight(totalLength, padding)
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Visual Basic Forum.