MOO-cows Mailing List Archive

[Prev][Next][Index][Thread]

Re: Parsing



Ya, (Im typing this out real quick so this might not work, but it should.
I'm sure there there are programmers out there who would hand you a much 
better peice of code than this but it will do.
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;

Umm...I beleive this should work.  this is assuming it will only be 
getting three words....if you need it to do more than three words then 
that of course will have to be re-written.

On Sun, 26 Nov 1995, James Renken wrote:

> Is it possible to have some verb on the MOO, when fed the args "/foo/bar/etc", 
> to return "{"foo", "bar", "etc"}"?
> 
> Thanks...
> 
> -----------------------------------------------------------------------
> James Renken - Renk0006@Gold.TC.UMN.Edu - http://acm.cs.umn.edu/~jpr
> Administrator, GopherMOO: Reality.CS.UMN.Edu 6464 - 3.1: GCS d- s-:+/++
> a11 C++++ US++/UH++/UI+ P+>++ L E---- W+++ N+++ o+ K- w--- O-->O++ M+
> V-- PS PE Y+ PGP- t+ 5? X? R tv-- b++++ DI++++ D? G++ e h! !r y !z
> Notice: Unsolicited commercial e-mail is subject to an archival fee of
> 200 US dollars per message - mailing denotes acceptance of these terms.
> -----------------------------------------------------------------------
> 
> 



Follow-Ups: References:

Home | Subject Index | Thread Index