String.Format

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.
 
D

Dennis Myrén

Have a look at the System.String instance members of PadLeft and PadRight.
They are a really nice feature.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top