Edit()

From TinyMUX
Revision as of 19:20, 11 December 2005 by Ian (talk | contribs) (Fixed 11AM-and-no-sleep typos)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Edit()

FUNCTION: edit(string,where,what)

This function puts a what everyplace it sees a where (case sensitive) in string with two exceptions:

If where is ^, put what before string. If where is $, put what after string.

Server Differences

In PennMUSH, edit() can accept an arbitrary number of arguments for this function. This has the outward appearance of nested edit()s: edit(edit(edit(string,where1,what1),where2,what2),...,...) but instead takes up only one function invocation and looks like: edit(string,where1,what1,where2,what2,...,...)

Examples

> say edit(abcdefg,cd,|||)
You say, "ab|||efg"
> say edit(Spliced splines!, pli,ar)
Sarced sarnes!
> say edit(01234,$,abc)
01234abc
> say edit(01234,^,abc)
abc01234

See also: @edit