<-- Previous || Up || Next -->

Str Ins Sub
String Manipulations Class

Public Sub StrIns( _
      ByRef rDest As Variant _
    , ByVal vSource As Variant _
    , Optional ByVal vInsertPosition As Variant _
    )

"String Insert"
Insert one string into the middle of another string.
vSource is inserted into vDest before character position vInsertPosition.
Similar to the InsertString function, except that this is a Subroutine which modifies its first argument instead of returning a value.

Example:
    Assuming
       Dim S As String
       S = "ABCDEF"
    for example
       StrIns S, "GHI", 4
    leaves
       S = "ABCGHIDEF"
See also:
    InsertString Function
    StrDel Subroutine
Subroutine does nothing if both strings (vDest and vSource) are Null.

rDest: The string into which vSource is to be inserted. rDest defaults to an empty string if it is Null or cannot be fixed up to a String.

vSource: The string which is to be inserted into rDest. vSource defaults to an empty string if it is Null or cannot be fixed up to a String.

vInsertPosition: The character position within vDest before which vSource will be inserted. vInsertPosition defaults to 1 (one) if it is missing or Null or cannot be fixed up to a number.

vSource is inserted at the beginning of vDest if vInsertPosition is < 1 (less than one).

vSource is inserted after the end of vDest if vInsertPosition is greater than the length of vDest.

Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.