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

Overlay String Function
String Manipulations Class

Public Function OverlayString( _
      ByVal vTo As Variant _
    , ByVal vFm As Variant _
    , Optional ByVal vOffset As Variant _
    ) As Variant

Overlays the string vFm on top of string vTo at an offset of vOffset.
Any portion of vFm which, when overlaid onto vTo at an offset of vOffset, would be before the beginning of vTo or past its end is ignored/truncated.

Examples:
    OverlayString("123456789", "ABC", 4) = "123ABC789"
    OverlayString("123456789", "ABC", -2) = "C23456789"
    OverlayString("123456789", "ABC", 8) = "12345678A"
See also:
    InsertString Function
vTo: The string onto which vFm is to be overlaid. Function returns Null if vTo is Null or cannot be fixed up to a String.

vFm: The string which is to be overlaid onto vTo. Function returns Null if vFm is Null or cannot be fixed up to a String.

vOffset: The starting character position with vTo at which vFm is to be overlaid. vOffset defaults to 0 (zero) if it is missing or Null or cannot be fixed up to a number.
Note: vOffset is an offset which is one less than what the starting position would be.

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