Signature (Visual Basic / VBA)
Public Function TruncateRightWithEllipse( _
ByVal vLine As Variant _
, ByVal vMaxLen As Variant _
) As Variant
Code Example
TruncateRightWithEllipse("This is a test.", 20) = "This is a test."
TruncateRightWithEllipse("This is a test.", 11) = "This is ..."
TruncateRightWithEllipse("This is a test.", 10) = "This ..."
Parameters
| Parameter | Description |
|---|---|
| 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. |