[DGD]Need tips with LPC function Im writing.

sampsa at netsonic.fi sampsa at netsonic.fi
Sun Mar 21 16:54:56 CET 1999



On Mon, 22 Mar 1999, MUD Account wrote:

> Hi - I need some help with a function Im writing for
> the mud Im working on based upon Melville.
> My background is mostly C, so Im at a bit of a loss
> as to how to do this in LPC.  Well I could do it, but
> it would be VERY messy and probably not very fast.
> Im basically looking for some tips on how to write
> a find_replace(string str, string find, string replace_with)
> type of function.  ie. since you dont have strstr() and similar,
> whats the quickest way to find a string inside of a string?

 implode(explode(find+str+find,find),replace_with) should do the trick

 - Sampsa Ranta
   sampsa at netsonic.fi


List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list