# Parsing

William Kaster (wsk@hpssl100.mayfield.hp.com)
Mon, 27 Nov 1995 14:36:50 PST

- Messages sorted by:[ date ][ thread ][ subject ][ author ]

    > txtb="";
    > txt=args[1];
    > txt=txt[2..length(txt)];
    > n=index(txt,"/");
    > txtb=txtb+txt[1..n-1];
    > txt=txt[n+1..length(txt)];
    > n=index(txt,"/");
    > txtb=txtb+txt[1..n-1];
    > txt=txt[n+1..length(txt)];
    > txtb=txtb+txt;
    > return txtb;
    >

    Oh, my!  How about:

    ;$string_utils:explode("/foo/bar/etc","/")
    => {"foo", "bar", "etc"}
    [used 71 ticks, 0 seconds.]

    >
    > > Is it possible to have some verb on the MOO, when fed the args "/foo/bar/etc",
    > > to return "{"foo", "bar", "etc"}"?
    > >
    > > Thanks...
    > >