Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Code to strip characters and split strings!!

Status
Not open for further replies.

fourpastmidnight

Programmer
Jan 7, 2002
21
0
0
US
Dear All:

A couple of years back, I was working at Merck in an Access97 database and the need arose to strip characters out of strings to format names, addresses, etc., and split strings in a variety of ways based on the characters involved.

I wrote two sub-routines that are extremely helpful that others have also found helpful. They are: StripChars(ByRef StringToParse as String, ByVal UnwantedChars as String) and will strip any characters in UnwantedChars from StringToParse; and SplitString(ByRef colSplitString As Collection, ByVal StringToSplit as String, ByVal StringToSplitOn, Optional ByVal SplitOptions As Integer = 1), which has 8 different options for splitting strings. Please see the accompanying article I wrote with submission of my code.

The code can be downloaded for free and can be modified to fit your needs as long as copyright information remains intact. You can also view what others have had to say about my code and post comments yourself.

If you need any help with the code, please feel free to contact me at fourpastmidnight@hotmail.com and I will try my best to help you.

At long last, here's the URL:
Thanks, and I hope you find these routines useful.

P.S. I'm working on a new function to be placed into this module that will replace SplitString and it will be called Sir(...) (Strip, Insert, and Replace). I think it's acronym is pretty self-explanatory, and this function will work on both strings and characters (if appropriate) when it is complete.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top