VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



This is really easy.. I download code all the time and I think it's time to return the favor.. This

by Myron Wix (1 Submission)
Category: String Manipulation
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Fri 6th December 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)

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



' 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

Download this snippet    Add to My Saved Code

This is really easy.. I download code all the time and I think it's time to return the favor.. This Comments

No comments have been posted about This is really easy.. I download code all the time and I think it's time to return the favor.. This. Why not be the first to post a comment about This is really easy.. I download code all the time and I think it's time to return the favor.. This.

Post your comment

Subject:
Message:
0/1000 characters