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

Compress Spaces Function
String Manipulations Class

Public Function CompressSpaces( _
    ByVal vValue As Variant _
    ) As Variant

Compresses all whitespace down to a single space character.
Replaces all repeated runs of space-type characters (space, tab, carriage return, etc.) with a single space character.
Uses the IsSpace function with the currently-loaded character classifications to determine which characters are considered "space".

    CompressSpaces("Now  is" + vbCrLf + "the  time.  ") = "Now is the time. "
See also:
    ReplaceStringRecursively Function
    IsSpace Function
vValue: The string from which repeated sequences of space-type characters are to be removed. Function return Null if vValue is Null or cannot be fixed up to a String.

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