They are html character codes and can be fixed like so...
Public Function HTMLDecode(ByVa l objText As Object) As String
Dim strTemp As New System.Text.Str ingBuilder(256)
Dim strExpTab As String
If TypeOf objText Is System.DBNull Then
strTemp.Append( " ")
Else
' Create tab expansion string if not done already
If strExpTab Is Nothing Then
strExpTab = New String(" "c, 4).Replace(" ", " ")
End If
strTemp.Append( HttpUtility.Htm lDecode(objText .ToString()))
'strTemp.Append (HttpUtility.Ht mlEncode(objTex t.ToString()))
strTemp.Replace (" ", " &nbs p;") ' Two spaces
strTemp.Replace (ControlChars.T ab, strExpTab)
strTemp.Replace (ControlChars.C r, "")
strTemp.Replace (ControlChars.L f, "<br>")
If strTemp.Length = 0 Or (strTemp.Length = 1 And strTemp(0) = " "c) Then
strTemp.Remove( 0, strTemp.Length) .Append(" ")
End If
End If
Return strTemp.ToStrin g()
End Function 'HTMLDecode
I borrowed an idea I found elsewhere. that author used the htmlencode method
of the httputitlity.
Thanks,
Pat
"Vb2Machine s" <No****@hotmail .com> wrote in message
news:ul******** ******@TK2MSFTN GP14.phx.gbl...
Hello to all
I have an ASP.NET application that uses VB.NET as the background
language and SQL server 2K as the back end database. I just recently
converted this application from classic asp and I have some erratic
behavior that I can't understand.
Some of the text is being saved and returned in patterns like the
following. ∙
The constant in all of it is that the string starts with &# and ends with
; and there is a sequence of numbers contained in the middle. What is it
and is there a better solution that a regular expression to search for the
pattern and replace it? If not does anyone know how to form the string for
the regex that will find it?
Thanks in advance,
Pat