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

Unformat Line Function
Formats Justifies Class

Public Function UnformatLine( _
      ByVal vValue As Variant _
    , Optional ByVal vSeparator As Variant _
    , Optional ByVal vCompare As Variant _
    ) As Variant

Selectively removes the line termination strings from a block of text.
Opposite of the WrapText function which adds line separation strings to a block of text so that the lines are each less than or equal to some specified length.
The line separator strings are replaced with one or two spaces, as appropriate.

Examples:
    UnformatLine("This" + vbCrLf + "is" + vbCrLf + "a" + vbCrLf + "test.") = "This is a test."
    UnformatLine(WrapText(Gettysburg, 65)) = Gettysburg
See also:
    WrapText Function
Note: Indented and blank lines are left as is, such as, they are left with their line termination string.

vValue: String which is to be "unformatted" by having its line separator characters removed. Function returns Null if vValue is Null or cannot be fixed up to a String.

vSeparator: The string which separates the lines of text in string vText. vSeparator defaults to carriage return and new line characters if it is missing or Null or cannot be fixed up to a String.

Function returns vValue unchanged if the line separator vSeparator is an empty string.

vCompare: Specifies the type of comparison used to locate the line separator string within vValue. vCompare defaults to Binary comparisons if it is missing or Null or cannot be fixed up to a number.

Indented lines (lines with leading spaces) and blank lines are left as is.

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