Jump to content

Word wrap: Difference between revisions

Line 2,020:
j = i + width
j -= 1 while txt[j] != " "
para << txt[i ... j-1]
i = j + 1
end
para.join("\n")
end
end
Line 2,044:
end</lang>
 
{{out}}
outputs
<pre>
 
<pre>........................................................................
In olden times when wishing still helped one, there lived a king whose
daughters were all beautiful, but the youngest was so beautiful that the
Line 2,064:
forest and sat down by the side of the cool fountain, and when she was bored she
took a golden ball, and threw it up on high and caught it, and this ball was her
favorite plaything.</pre>
</pre>
 
=={{header|Run BASIC}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.