Re: Stripping out unwanted characters
- From: "Juan T. Llibre" <nomailreplies@xxxxxxxxxxx>
- Date: Wed, 22 Feb 2006 09:34:16 -0400
Function StripUnwantedChars(ByVal StringToStrip AsString) AsString
Dim stripped AsString
If StringToStrip <> "" Then
stripped = Regex.Replace(StringToStrip, "<(.|\n)+?>", String.Empty)
Return stripped
Else
Return ""
EndIf
EndFunction
Note : insert all the characters you want to strip inside the quotes.
For example, instead of :
stripped = Regex.Replace(StringToStrip, "<(.|\n)+?>", String.Empty)
use :
stripped = Regex.Replace(StringToStrip, "<!#(.|\n)+?>", String.Empty)
Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"et" <eagletender2001@xxxxxxxxx> wrote in message news:ODVkXK7NGHA.668@xxxxxxxxxxxxxxxxxxxxxxx
How can I strip out unwanted characters in a string before updating the database? For instance,
in names & addresses in our client table, we want only letters and numbers, no punctuation. Is
there a way to do this?
.
- References:
- Stripping out unwanted characters
- From: et
- Stripping out unwanted characters
- Prev by Date: Re: Stripping out unwanted characters
- Next by Date: Problems with Thread Impersonation
- Previous by thread: Re: Stripping out unwanted characters
- Next by thread: Re: Stripping out unwanted characters
- Index(es):