ldmud-3.2.9/doc/
ldmud-3.2.9/doc/efun/
ldmud-3.2.9/mud/
ldmud-3.2.9/mud/heaven7/
ldmud-3.2.9/mud/heaven7/lib/
ldmud-3.2.9/mud/lp-245/
ldmud-3.2.9/mud/lp-245/banish/
ldmud-3.2.9/mud/lp-245/doc/
ldmud-3.2.9/mud/lp-245/doc/examples/
ldmud-3.2.9/mud/lp-245/doc/sefun/
ldmud-3.2.9/mud/lp-245/log/
ldmud-3.2.9/mud/lp-245/obj/Go/
ldmud-3.2.9/mud/lp-245/players/lars/
ldmud-3.2.9/mud/lp-245/room/death/
ldmud-3.2.9/mud/lp-245/room/maze1/
ldmud-3.2.9/mud/lp-245/room/sub/
ldmud-3.2.9/mud/lp-245/secure/
ldmud-3.2.9/mud/morgengrauen/
ldmud-3.2.9/mud/morgengrauen/lib/
ldmud-3.2.9/mud/sticklib/
ldmud-3.2.9/mud/sticklib/src/
ldmud-3.2.9/mudlib/uni-crasher/
ldmud-3.2.9/pkg/
ldmud-3.2.9/pkg/debugger/
ldmud-3.2.9/pkg/diff/
ldmud-3.2.9/pkg/misc/
ldmud-3.2.9/src/autoconf/
ldmud-3.2.9/src/bugs/
ldmud-3.2.9/src/bugs/MudCompress/
ldmud-3.2.9/src/bugs/b-020916-files/
ldmud-3.2.9/src/bugs/doomdark/
ldmud-3.2.9/src/bugs/ferrycode/ferry/
ldmud-3.2.9/src/bugs/ferrycode/obj/
ldmud-3.2.9/src/bugs/psql/
ldmud-3.2.9/src/done/
ldmud-3.2.9/src/done/order_alist/
ldmud-3.2.9/src/done/order_alist/obj/
ldmud-3.2.9/src/done/order_alist/room/
ldmud-3.2.9/src/gcc/
ldmud-3.2.9/src/gcc/2.7.0/
ldmud-3.2.9/src/gcc/2.7.1/
ldmud-3.2.9/src/hosts/
ldmud-3.2.9/src/hosts/GnuWin32/
ldmud-3.2.9/src/hosts/amiga/NetIncl/
ldmud-3.2.9/src/hosts/amiga/NetIncl/netinet/
ldmud-3.2.9/src/hosts/amiga/NetIncl/sys/
ldmud-3.2.9/src/hosts/i386/
ldmud-3.2.9/src/hosts/msdos/byacc/
ldmud-3.2.9/src/hosts/msdos/doc/
ldmud-3.2.9/src/hosts/os2/
ldmud-3.2.9/src/hosts/win32/
ldmud-3.2.9/src/util/
ldmud-3.2.9/src/util/erq/
ldmud-3.2.9/src/util/indent/hosts/next/
ldmud-3.2.9/src/util/xerq/
ldmud-3.2.9/src/util/xerq/lpc/
ldmud-3.2.9/src/util/xerq/lpc/www/
Short: new efun substitute_string()
From: Dave Setty <garpoz@locallink.net>
Date: Thu, 10 Dec 1998 02:03:04 -0500
Type: Feature
State: Unclassified
See also: f-020404

I've also got some various patches around that I'd like to see in there.
Lars, if you're interested in any of this let me know...
1) subst(), which is similar to MudOS's replace_string() which in turn
   is a more refined version of the old implode(explode()) trick. Mine
   can take two arrays or a mapping of search/replace pairs though.

--- Doomdark:
If I'm not mistaken, this is similar to 'substitute_string()'-efun
I made, which takes 2 string arrays to define the strings to replace.
It can be found from 'bugs/doomdark/strutil.c'-file from the ldmud-3.2.5
if you are interested. The extra arguments (min and max length
of the aliases to substitute) are just for optimizing the speed; also,
the first array is expeceted to be sorted to allow binary search of
the substitutions. Finally, the substitution is done by scanning the
whole string just once, and by using a static replace buffer (no mallocs
except for one used for mallocing room for the returned string, _if_
any substitutions were made). All in all, I tried to do a somewhat
optimized version which could be used for alias subsitution in command
strings; since this is called for every command players enter, it
should be made as fast as possible.
----

Suggestion by Matthew Julius:
varargs string strsubst(string, string|mapping|string*, string|string*)
  String replacement/substitution...
  Examples,
    strsubst("abc", "ab", "1") == "1c"
    strsubst("abc", ({ "a", "b" }), ({ "1", "2" })) == "12c"
    strsubst("abc", ([ "a": "1" ])) == "1bc"
    strsubst("abc", ({ "d" }), ({ "1" })) == "abc"
  The Timewarp mudlib has historically called this subst().