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

[REBOL] Re: Alternate TRIM need

From: moliad:aei:ca at: 24-Aug-2004 20:52

John W. Inman Jr. wrote:
> I need to trim a string's delimiters. Is there a built in function for > this? > > Or does someone have a nice function?
trim has a /with refinement which should do specifically what you want...
>> print trim/with {"123-4567"} {"}
123-4567 PS: try the help function in the console... it gives many questions :-) ex:
> help trim
USAGE: TRIM series /head /tail /auto /lines /all /with str DESCRIPTION: Removes whitespace from a string. Default removes from head and tail. TRIM is an action value. ARGUMENTS: series -- (Type: series port) REFINEMENTS: /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) HTH! -MAx