Site Tools


insert

# $EPIC: insert.txt,v 1.3 2007/03/02 02:32:04 jnelson Exp $

Synopsis:

$insert(<num> <word> <text>)

Technical:

  • The <word> argument is a dword which is different from most function arguments.
  • If the <num> integer argument is omitted the empty string is returned.
  • If the <word> argument is omitted the empty string is returned.
  • The return value of this function is <text> with the <word> argument inserted after the <num>th character.

Practical:

This function can be used to insert text into the middle of a string at a known location. You probably found the location by using $index() or $rindex().

Returns:

input <text> with <word> inserted after the <num>th character

Examples:

$insert(3 baz foobarbooya)  returns "foobazbarbooya"
insert.txt · Last modified: 2007/03/02 02:32 by 127.0.0.1