[REBOL] Trim question Re:(2)
From: ingo:2b1 at: 11-Oct-2000 8:54
Once upon a time [brett--codeconscious--com] spoketh thus:
> > Can someone tell me what makes this fail?
> >
> > >> a: { one two
> > { three four }
> > == " one two^/ three four "
> > >> a2: trim/auto copy a
> > == "one two^/ three four "
<...>
As to my understanding it's correct:
trim/auto unindents the first line, and conserves indentation
relative to this line, let's see
>> print trim/auto {abc^/ def}
abc
def
>> print trim/auto { abc^/ def}
abc
def
>> print trim/auto { abc^/ def}
abc
def
In the first example nothing got changed, because the first
line wasn't indented.
In the second all whitespace got deleted, because the lines
were indented equally,
and in the last example the three spaces that the second line
was indented deeper were preserved.
I hope that helps,
Ingo