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

Keep Characters Function
Character Arrays Class

Public Function KeepCharacters( _
      ByVal vLine As Variant _
    , ByVal vKeepChars As Variant _
    , Optional ByVal vCompare As Variant _
    ) As Variant

Return a string containing all of the characters in vLine that also appear in vKeepChars.
This is the opposite of the StripCharacters function.

Example:
    KeepCharacters("CBA123CBA", "ABCDEFGHI") = "CBACBA"
See also:
    KeepRangeOfCharacters Function
    IntersectCharacters Function
    StripCharacters Function
Note: Similar to the KeepRangeOfCharacters function, except that one requires the range of ASCII values that will kept and it uses Binary comparisons.

vLine: String containing the characters which will be copied to the result string only if they also appear within string vKeepChars. Function returns Null if vLine is Null or cannot be fixed up to a String.

vKeepChars: String containing the characters which will be copied to the result string each time they appear within string vLine. Function returns Null if vKeepChars is Null or cannot be fixed up to a String.

vCompare: specifies the type of string comparison used to determine if characters match. vCompare defaults to Binary comparisons if it is missing or Null or cannot be fixed up to a number.

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