Re: string format

2005-08-27 Thread Marielle Lange
There was some discussion not long ago on how to add spaces such that a string fills a given fixed length. I discovered today that it was in fact possible to use the equivalent of the sprintf command found in c: format(baseString[,valuesList]) format("Hello world") -- returns "Hello world"

Re: string format

2005-08-27 Thread Alex Tweedly
Marielle Lange wrote: There was some discussion not long ago on how to add spaces such that a string fills a given fixed length. I discovered today that it was in fact possible to use the equivalent of the sprintf command found in c: The format function is indeed very useful - but I don't

Re: string format

2005-08-27 Thread Charles Hartman
On Aug 27, 2005, at 7:49 PM, Alex Tweedly wrote: The format function is indeed very useful - but I don't think it can be used to solve the particular problem of adding spaces after a string to fill it out to a specified length. Or at least - when I was looking at the problem the other day,

Re: string format

2005-08-28 Thread Marielle Lange
Alex, The format function is indeed very useful - but I don't think it can be used to solve the particular problem of adding spaces after a string to fill it out to a specified length. Or at least - when I was looking at the problem the other day, one of the alternatives I considered was

Re: string format

2005-08-28 Thread Alex Tweedly
Charles Hartman wrote: On Aug 27, 2005, at 7:49 PM, Alex Tweedly wrote: The format function is indeed very useful - but I don't think it can be used to solve the particular problem of adding spaces after a string to fill it out to a specified length. Or at least - when I was looking at t

Re: string format

2005-08-28 Thread Charles Hartman
On Aug 28, 2005, at 5:01 AM, Alex Tweedly wrote: . . . the particular problem of adding spaces after a string to fill it out to a specified length. It would work if the "incantation" argument of format() would accept a variable name, but I can't find a way to make it do that . . . Yo

Re: string format

2005-08-28 Thread Alex Tweedly
Charles Hartman wrote: On Aug 28, 2005, at 5:01 AM, Alex Tweedly wrote: . . . the particular problem of adding spaces after a string to fill it out to a specified length. It would work if the "incantation" argument of format() would accept a variable name, but I can't find a way to ma