[Newbies] String construction and replacement

Matthias Berth matthias.berth at googlemail.com
Mon Feb 2 16:22:45 UTC 2009

For your particular need (normalizing line breaks), use:

  aString withSqueakLineEndings

That gives you a defined line end convention, suitable for use with
other methods like linesDo:.



On Mon, Feb 2, 2009 at 4:09 PM, Sebastian Nozzi <sebnozzi at googlemail.com> wrote:
> No, actually no.
> But the background to my question (which I didn't mention since it
> doesn't belong to this list) is that I was dealing with a Seaside
> issue in which one string's newlines came back with CR+LF (carriage
> return and line feed) and under other conditions it came back as
> having LF+LF.
> I wanted to construct a String for these exact sequences and do the
> appropriate replacement (that is replace all LF+LF ocurrences for
> CR+LF).
> I am very glad that in Smalltalk it's possible to write a
> string-literal like you did (with a newline in-between).
> 2009/2/2 Ken G. Brown <kbrown at mac.com>:
>> Is there something wrong with just doing:
>> string := 'Hello
>> There'.
>> ?
>> Ken G. Brown
> _______________________________________________
> Beginners mailing list
> Beginners at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/beginners

More information about the Beginners mailing list