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

Remove characters from the end of a string

 [1/4] from: brasilv:tin:it at: 19-Nov-2005 11:48


Hi List, I've got a big problem, I've a string:
> cmd-iso: "mkisofs -R -J -o %/c/programmi/openpc/backup/back.iso %" > cmd-iso: append cmd-iso selected-dir
(I'm quite sure that's a string because the 'type? function told me it was). I want to remove from that string the last character, that is a "/", because:
> selected-dir: request-dir ;so I've got a directory name that always ends
with "/" (isn't it?) But in my script this "/" must be removed, if I make this:
> remove last cmd-iso
I got this error on executing the script:
>** Script Error: remove expected series argument of type: series port
bitset none
>** Where: func [face value][ > cmd-iso: copy cmd-iso > remove last cmd-iso > print cmd-iso >] >** Near: remove last cmd-iso
Why? Please let me understand why, I need it desperately!!! Thank you very very much, Silvia

 [2/4] from: SunandaDH::aol::com at: 19-Nov-2005 5:56


One way: head remove back tail cmd-iso Sunanda

 [3/4] from: greggirwin::mindspring::com at: 19-Nov-2005 13:18


Hi Silvia,
>> cmd-iso: "mkisofs -R -J -o %/c/programmi/openpc/backup/back.iso %" >> remove last cmd-iso
SB> I got this error on executing the script:
>>** Script Error: remove expected series argument of type: series port
SB> bitset none As you learn REBOL, the console is your friend. Did you look at what value LAST returned? What does HELP LAST tell you? Break things down into little pieces, and them out in the console bit by bit. Happy REBOLing! -- Gregg

 [4/4] from: compkarori::gmail::com at: 20-Nov-2005 1:14


Another way, shorter but computationally longer reverse remove reverse cmd-iso On 11/19/05, SunandaDH-aol.com <SunandaDH-aol.com> wrote:
> One way: > > head remove back tail cmd-iso > > Sunanda
-- Graham Chiu