Answered
how to pad a string
i am tryign to pad a strign with 38 blank spaces at the end.
i tried the following:
<cfset filler="THisIsMyStringToPad">
<cfloop from="1" to="38" index="LoopCount">
<cfset filler= #variables.Filler# & " ">
#LoopCount#<br />
</cfloop>
but when i output #variables.Filler# to the screen, all i get is one space.
and i know it is going all the way through the loop because if i output loopcount on each iteration i get 1-38.
so what am i doing wrong? is there an easier way?
<cfset filler="THisIsMyStringToPad">
<cfloop from="1" to="38" index="LoopCount">
<cfset filler= #variables.Filler# & " ">
#LoopCount#<br />
</cfloop>
but when i output #variables.Filler# to the screen, all i get is one space.
and i know it is going all the way through the loop because if i output loopcount on each iteration i get 1-38.
so what am i doing wrong? is there an easier way?
