StrInsert

Inserts a new string into an existing string. (Windows NT and newer)

Syntax:

StrInsert (base-string, new-string, [pad-string [, start [, length]]])

Parameters:

(s) base-string: specifies the existing string.

(s) new-string: specifies the string to be inserted into "base-string".

(s) pad-string: (optional) specifies a character or string to be used for padding, if necessary.  The default is a space (' ').

(i) start: [optional] specifies the position in "base-string" before which the "new-string" is to be inserted, where the position of the first character of the string is 1.  To insert at the very beginning of "base-string", specify a value of 1.  You can specify -1 to insert after the end of "base-string".  If "start" is past the end of "base-string", padding will be inserted between the end of "base-string" and the beginning of "new-string".  The default is 1.

(i) length: [optional] specifies the number of characters to insert.  If "length" is shorter than the length of "new-string", "new-string" will be truncated.  If "length" is longer than the length of "new-string", padding will be inserted after the end of "new-string".  The default is the length of "new-string".

Returns:

(s) the modified string.

Example:
 
Name = "Joe" ret = StrInsert ( "Hello my name is ", name, " ", -1 , StrLen( name ) ) Message( "StrInsert() Example", ret )
See Also:

StrCharCount, StrByteCount, StrFill, StrFix, StrIndex, StrIndexNc, StrOverlay, StrScan, StrTrim, StrTrimChar