REBOL 3.0

TRIM Block

Carl Sassenrath, CTO
REBOL Technologies
5-Apr-2007 0:20 GMT

Article #0081
Main page || Index || Prior Article [0080] || Next Article [0082] || 7 Comments || Send feedback

Like trim on strings you can now do trim on blocks. But, rather than remove spaces, trim on blocks removes NONEs.

Valid refinements are /all, /head, and /tail, and work as you would expect (same as strings).

Example is:

>> blk: reduce [1 none "test" none 'word]
>> trim/all blk
== [1 "test" word]

This native action is much faster than doing it at mezzaine level.

Perhaps later we can add /with refinement to trim other types of values, or even values by datatype (like trim/with block string! to remove all strings).

7 Comments

REBOL 3.0
Updated 22-Nov-2024 - Edit - Copyright REBOL Technologies - REBOL.net