- Home
·
- String Manipulation
·
- This is really easy.. I download code all the time and I think it's time to return the favor.. This
This is really easy.. I download code all the time and I think it's time to return the favor.. This
This is really easy.. I download code all the time and I think it's time to return the favor.. This function will strip unwanted characters
Rate This is really easy.. I download code all the time and I think it's time to return the favor.. This
(1(1 Vote))
' return the favor.. This function will strip unwanted characters from a string
' like
' StripChar("(555) 555-5555,"() -") will return "5555555555"
' and StripChar("555-55-5555","-") will return "555555555"
Function StripChar(Var As String, Strip As String)
Dim PK As Long ' Place keeper
Dim Inst As Integer ' Instance
Dim Parsing As String ' My parsing var
For Inst = 1 To Len(Strip)
For PK = 1 To Len(Var)
Debug.Print Mid(Strip, Inst, 1) ' to find what instance it's on
If Mid(Var, PK, 1) <> Mid(Strip, Inst, 1) Then
Parsing = Parsing & Mid(Var, PK, 1)
End If
Next PK
Var = Parsing
Parsing = ""
Next Inst
StripChar = Var
End Function
This is really easy.. I download code all the time and I think it's time to return the favor.. This Comments
No comments yet — be the first to post one!
Post a Comment