Function Reference


_StringInsert

Inserts a string within another string

#include <String.au3>
_StringInsert ( $sString, $sInsertString, $iPosition )

Parameters

$sString Original string
$sInsertString String to be inserted
$iPosition Position to insert string (negatives values count from right hand side)

Return Value

Success: a new modified string.
Failure: the original string and sets the @error flag to non-zero.
@error: 1 - Invalid position

Remarks

Use negative position values to insert string from the right hand side.

Example

#include <String.au3>

; Inserts three "moving" underscores and prints them to the console.
For $i = -20 To 20
    ConsoleWrite($i & @TAB & _StringInsert("Supercalifragilistic", "___", $i) & @CRLF)
Next