For the people that still want the answer to this.
string newString = oldString.PadLeft(100,' ');
will pad the left hand side up to 100 characters and PadRight will do it to
the right hand side.
--
Ciaran O''Donnell
http://wannabedeveloper.spaces.live.com
"0to60" wrote:
> Alberto Poblacion wrote:
>
> > One easy way to do it is String.Format:
> >
> > decimal n = 3.14m;
> > string formatted = string.Format("{0:0000000#}", n*100);
> >
> > By editing the format string and adding additional parameters, you can
> > format all the values that go into one record for your file in one go.
>
> Perfect!
>
> Now, is there a way to front pad a string with spaces? I need fixed width
> strings, and they have to be front padded with spaces.
>
>