[Pharo-project] Printing an array on file without quotes

Torsten Bergmann astares at gmx.de
Thu Nov 25 16:02:12 CET 2010

Just use #nextPutAll: 

myArray := #(1 2 3 4).
FileStream forceNewFileNamed: 'foo.txt' do: [ :stream | 
  stream nextPutAll: myArray asCommaString withoutQuoting ] 

If you want to print a single character use #nextPut: 

Note that Transcript is also a stream, so it often helps
to write to Transcript first and later switch to the file(stream)
to check writing results.

Have fun

Neu: GMX De-Mail - Einfach wie E-Mail, sicher wie ein Brief!  
Jetzt De-Mail-Adresse reservieren: http://portal.gmx.net/de/go/demail

More information about the Pharo-project mailing list