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

Truncate Left With Ellipse Function
String Manipulations Class

Public Function TruncateLeftWithEllipse( _
      ByVal vLine As Variant _
    , ByVal vMaxLen As Variant _
    ) As Variant

Truncate/remove the left part of the string vLine if it is longer than vMaxLen,
If the string is truncated, replace the leading characters with "..." to indicate the removal.

Examples:
    TruncateLeftWithEllipse("This is a test.", 20) = "This is a test."
    TruncateLeftWithEllipse("This is a test.", 11) = "... a test."
    TruncateLeftWithEllipse("This is another test.", 11) = "... test."
See also:
    TruncateRightWithEllipse Function
    RightJustifyTruncateFast Function
vLine: The string value which is a candidate for truncation. Function returns Null if vLine is Null or cannot be fixed up to a String.

vMaxLen: The maximum length of the string, above which size the string vLine will be truncated. Function returns Null if vMaxLen if Null or cannot be fixed up to a number.

Function returns an empty string if vMaxLen is <= 0 (less than or equal to zero).

Fully remove any partial word which would be left where the oversized part of the string is truncated.

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