Stripping a string from a string
From: Mark Durrenberger (durrenm_at_yahoo.com)
Date: 07/12/04
- Next message: Don_at_home.com: "Re: Stripping a string from a string"
- Previous message: Veign: "Re: VB Equivalent for Access Application.Echo"
- Next in thread: Don_at_home.com: "Re: Stripping a string from a string"
- Reply: Don_at_home.com: "Re: Stripping a string from a string"
- Reply: Steven Burn: "Re: Stripping a string from a string"
- Reply: Paul Bobrowski: "Re: Stripping a string from a string"
- Reply: Veign: "Re: Stripping a string from a string"
- Reply: Jeff Johnson [MVP: VB]: "Re: Stripping a string from a string"
- Reply: J French: "Re: Stripping a string from a string"
- Reply: Beeeeeeeeeeeeves: "RE: Stripping a string from a string"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 12 Jul 2004 14:14:24 -0400
I wrote a routine to strip any occurence of a character from a string (like
removing all spaces).
At the time I wrote it, I didn't think I'd be using it much and did not
worry about performance
Now I'm finding that I'm using often and wondered if there is a built in
function for doing the same thing...
My "code" is below. (please be gentle - I'm not a professional programmer
:-)
Thanks
Mark
Public Function oakStrip(StripString As String, StripChar As String) As
String
'
' strip a specified character from a string
'
Dim i As Integer
Dim strChar As String
Dim Result As String
For i = 1 To Len(StripString)
strChar = Mid$(StripString, i, 1)
If strChar <> StripChar Then
Result = Result & strChar
End If
Next i
oakStrip = Result
End Function
-- _________________________________________________________ Mark Durrenberger, PMP Principal, Oak Associates, Inc, www.oakinc.com "Advancing the Theory and Practice of Project Management" ________________________________________________________ The nicest thing about NOT planning is that failure comes as a complete surprise and is not preceded by a period of worry and depression. - Sir John Harvey-Jones
- Next message: Don_at_home.com: "Re: Stripping a string from a string"
- Previous message: Veign: "Re: VB Equivalent for Access Application.Echo"
- Next in thread: Don_at_home.com: "Re: Stripping a string from a string"
- Reply: Don_at_home.com: "Re: Stripping a string from a string"
- Reply: Steven Burn: "Re: Stripping a string from a string"
- Reply: Paul Bobrowski: "Re: Stripping a string from a string"
- Reply: Veign: "Re: Stripping a string from a string"
- Reply: Jeff Johnson [MVP: VB]: "Re: Stripping a string from a string"
- Reply: J French: "Re: Stripping a string from a string"
- Reply: Beeeeeeeeeeeeves: "RE: Stripping a string from a string"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|