TinyMUX

Mid()

Functions

FUNCTION: mid(<string>, <first>, <length>)

Positions and lengths are measured in visual characters (grapheme clusters).

If <length> is positive, mid() returns a segment of the string starting at position <first> and continuing to the right until the end of the string or <length> characters, whichever is satisfied first.

If <length> is negative, mid() returns a segment of the string ending at position <first> and continuing to the left until the beginning of the string or <length> characters, whichever is satisfied first.

The first character in a string is at position zero.

Left() is supported as an alias for strtrunc().

Related Topics: delete(), right(), strtrunc().