Read Me - Common Public License V1.0 - Copyright Notice(©)

insert


>>-insert(new-+---------------------------------------+-)------><
              +-,--+---+--+-------------------------+-+
                   +-n-+  +-,--+--------+--+------+-+
                               +-length-+  +-,pad-+

Returns a copy of the receiver string with the string [new] , padded or truncated to length [length] , inserted after the [n] th character. The default value for [n] is 0, which means insertion at the beginning of the string. If specified, [n] and [length] must be positive whole numbers or zero. If [n] is greater than the length of the receiving string, the string [new] is padded at the beginning. The default value for [length] is the length of [new] . If [length] is less than the length of the string [new] , then [insert] truncates [new] to length [length] . The default [pad] character is a blank.

String class - insert method

"abc"~insert("123")            ->    "123abc"
"abcdef"~insert(" ",3)         ->    "abc def"
"abc"~insert("123",5,6)        ->    "abc  123   "
"abc"~insert("123",5,6,"+")    ->    "abc++123+++"
"abc"~insert("123", ,5,"-")    ->    "123--abc"

Read Me - Common Public License V1.0 - Copyright Notice(©)