Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

trim

 [1/3] from: gchiu::compkarori::co::nz at: 18-Sep-2002 15:19


The default behaviour for trim appears flawed. Under IOS:
>> trim test1: { this is an embedded tab ^-which will be left alone }
== "this is an embedded tab ^-which will be left alone"
>> trim test2: { this is an embedded tab ^/^-which gets clobbered }
== "this is an embedded tab^/which gets clobbered"
>> trim/head/tail test2: { this is an embedded tab ^/^-which is left alone }
== "this is an embedded tab ^/^-which is left alone" -- Graham Chiu

 [2/3] from: gscottjones:mchsi at: 18-Sep-2002 5:57


From: "Graham Chiu"
> The default behaviour for trim appears flawed. > Under IOS:
<<quoted lines omitted: 3>>
> == "this is an embedded tab^/which gets clobbered" > >> trim/head/tail test2: { this is an embedded tab ^/^-which is left
alone }
> == "this is an embedded tab ^/^-which is left alone"
Hi, Graham, Same behavior on REBOL/View 1.2.1.3.1. I agree that the tab should not be removed from the test2 string, unless the /lines refinement is used. Appears to be a buglet to this observer. --Scott Jones

 [3/3] from: rotenca:telvia:it at: 18-Sep-2002 17:00


Hi Graham,
> >> trim test1: { this is an embedded tab ^-which will be left alone } > == "this is an embedded tab ^-which will be left alone"
<<quoted lines omitted: 3>>
> == "this is an embedded tab ^/^-which is left alone" > The default behaviour for trim appears flawed.
Help (and Core doc) says: "Removes whitespace from a string". It seems that instead trim removes leading and tailing space/tab from every lines in the string. What core/help says is the trim/head/tail behaviour. Could be that docs is flawed? --- Ciao Romano

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted