String.Format

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How can space fill a string to a fixed format?
It is easy with a number
RecordBase = String.Format("{0:000000}" ,storeid);
But not easy with a string
ponumber = String.Format("{0:GGGGGGGGGGGG}",ponumber);
The line above doesn't seem to work.
 
Have a look at the System.String instance members of PadLeft and PadRight.
They are a really nice feature.
 
Back
Top