Try output := col inject: '' into: [:a :b | a,b].<br><br>And check out the terse guide to Squeak:<br><br><a href="http://wiki.squeak.org/squeak/5699">http://wiki.squeak.org/squeak/5699</a>.<br><br>I can never remember the format for inject, but got it right somehow this time!<br>
<br>Rob<br><br><div class="gmail_quote">On Fri, May 22, 2009 at 3:51 PM, Paul DeBruicker <span dir="ltr"><<a href="mailto:pdebruic@gmail.com">pdebruic@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi<br>
<br>
I've created an ordered collection of strings. I'd like to paste each<br>
element of the ordered collection together into one long string that<br>
contains all of the elements of the ordered collection.<br>
<br>
So given this:<br>
| col |<br>
col := OrderedCollection with: 'asdf' with: '1234' with: 'aaaa'.<br>
<br>
<br>
I'd like to end up with this:<br>
<br>
'asdf1234aaaa'<br>
<br>
I've come up with this:<br>
| col |<br>
col := OrderedCollection with: 'asdf' with: '1234' with: 'aaaa'.<br>
String streamContents: [:stream | col do: [:i | stream print: i]]<br>
<br>
but that gives:<br>
'''asdf''''1234''''aaaa'''<br>
<br>
What else should I do? Thanks<br>
<br>
Paul<br>
_______________________________________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@lists.squeakfoundation.org">Beginners@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/mailman/listinfo/beginners" target="_blank">http://lists.squeakfoundation.org/mailman/listinfo/beginners</a><br>
</blockquote></div><br>