Signature (Visual Basic / VBA)
Public Function StripString( _
ByVal vLine As Variant _
, ByVal vFind As Variant _
, Optional ByVal vCompare As Variant _
) As Variant
Code Example
StripString("This is a test.", "is") = "Th a test."
StripString("This is a test.", " ") = "Thisisatest."
StripString("This is a test.", "12") = "This is a test."
StripString("This is a test.", "") = "This is a test." ' Behavior #3
Parameters
| Parameter | Description |
|---|---|
| vLine | The string which is to have all occurrences of vFind removed. Function returns Null if vLine is Null or cannot be fixed up to a String (Behavior #1). |
| vFind | The string which is to be removed from vLine wherever matches occur. Function returns Null if vFind is Null or cannot be fixed up to a String (Behavior #2). Function returns vLine unchanged if vFind is an empty String (Behavior #3). |
| vCompare | Specifies the type of comparison used to determine if strings match (Behavior #4). vCompare defaults to Binary comparisons if it is missing or Null or cannot be fixed up to a number (Behavior #5). |
Notes & Version History
| v1.5 Note | This function has been superceded by the Replace function in Visual Basic 6.0. It is similar to the Replace function in Visual Basic, except that this function allows the vFind argument to be Null, in which case it returns Null. Visual Basic's Replace function will generate a runtime error if its Find argument is Null. |
| v1.5 Pro Change | The implementation of this function has been changed to use the Replace function in Visual Basic. |