base.StringBuffer.insertAt

Insert a string at a given position.

Syntax

insertAt(
   part STRING,
   pos INTEGER )
  1. part is the string part to be inserted.
  2. pos is the position where the string must be inserted.

Usage

The insertAt() method inserts a string before the specified position in the string buffer.

Important: When using byte length semantics, the position is expressed in bytes. When using char length semantics, the unit is characters. This is matters when using a multibyte locale such as UTF-8.
CALL buf.append("abcdef")
CALL buf.insertAt(3, "xx")
DISPLAY buf.toString() -- Shows abcxxdef