Last modified on 13 November 2012, at 10:45

REBOL Programming/trim

USAGE:Edit

TRIM series /head /tail /auto /lines /all /with str 

DESCRIPTION:Edit

Removes whitespace from a string. Default removes from head and tail.

TRIM is an action value.

ARGUMENTSEdit

  • series -- (Type: series port)

REFINEMENTSEdit

  • /head -- Removes only from the head.
  • /tail -- Removes only from the tail.
  • /auto -- Auto indents lines relative to first line.
  • /lines -- Removes all line breaks and extra spaces.
  • /all -- Removes all whitespace.
  • /with
    • str -- Same as /all, but removes characters in 'str'. (Type: char string)

SOURCE CODEEdit

trim: native[
    {Removes whitespace from a string. Default removes from head and tail.} 
    series [series! port!] 
    /head "Removes only from the head." 
    /tail "Removes only from the tail." 
    /auto "Auto indents lines relative to first line." 
    /lines "Removes all line breaks and extra spaces." 
    /all "Removes all whitespace." 
    /with str [char! string!] "Same as /all, but removes characters in 'str'."
]