base.StringBuffer.insertAt

Insert a string at a given position.

Syntax

insertAt(
   pos INTEGER,
   part STRING )
  1. pos is the position where the string must be inserted.
  2. part is the string part to 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.

Example

CALL buf.append("abcdef")
CALL buf.insertAt(3, "xx")
DISPLAY buf.toString() -- Shows abcxxdef