Hello,
I need to replace this char  with another char.
However I am not able to acieve this. I tried this but it
doesnt work:
str = str.Replace(chr(asc(194)), "")
Can somebody help ? 12 2442
The "replace" needs either two characters or two strings. In your case, try:
Dim c As Char = Chr(194)
str = str.Replace(c.ToString, "")
Or why not just str.replace("Â", "")?
Bill
"anonymous" wrote: Hello,
I need to replace this char  with another char. However I am not able to acieve this. I tried this but it doesnt work:
str = str.Replace(chr(asc(194)), "")
Can somebody help ?
I tried both versions, but it still doesnt work. The thing
is that I am reading the following rss
( http://pluralsight.com/blogs/dbox/Rss.aspx) and creating
the file with the description of the item. The file
contains only the description with the strange chars. Here
is my complete code:
Dim reader As New XmlTextReader
("http://pluralsight.com/blogs/dbox/Rss.aspx")
Dim xmlDoc As New XmlDocument
xmlDoc.Load(reader)
Dim nodes As XmlNodeList = xmlDoc.SelectNodes
("/rss/channel/item")
dim i as integer = 0
For Each node As XmlNode In nodes
Try
strPost = node("description").InnerXml
Dim c as char = Chr(194)
strPost = strPost.Replace("Â", "XX")
Dim fp As StreamWriter
dim strfile as string = Server.MapPath("xml_news//")
strfile = strfile & i.tostring()
strfile = strfile & ".asp"
fp = File.CreateText(strfile)
fp.WriteLine("<p>" & Server.HtmlDecode(strPost)
& "</p>")
fp.close()
Catch ex As Exception
Response.Write(ex.Message() & "<br>")
End Try
i = i + 1
Next
Thanks for any help. -----Original Message----- The "replace" needs either two characters or two strings.
In your case, try: Dim c As Char = Chr(194) str = str.Replace(c.ToString, "")
Or why not just str.replace("Ã,", "")?
Bill
"anonymous" wrote:
Hello, I need to replace this char Ã, with another char. However I am not able to acieve this. I tried this but
it doesnt work: str = str.Replace(chr(asc(194)), "") Can somebody help ? .
I don't see any Âs in the feed? Is it really the character you want to
replace?
cheers,
mortb
"anonymous" <an*******@discussions.microsoft.com> wrote in message
news:46****************************@phx.gbl...
I tried both versions, but it still doesnt work. The thing
is that I am reading the following rss
( http://pluralsight.com/blogs/dbox/Rss.aspx) and creating
the file with the description of the item. The file
contains only the description with the strange chars. Here
is my complete code:
Dim reader As New XmlTextReader
("http://pluralsight.com/blogs/dbox/Rss.aspx")
Dim xmlDoc As New XmlDocument
xmlDoc.Load(reader)
Dim nodes As XmlNodeList = xmlDoc.SelectNodes
("/rss/channel/item")
dim i as integer = 0
For Each node As XmlNode In nodes
Try
strPost = node("description").InnerXml
Dim c as char = Chr(194)
strPost = strPost.Replace("Â", "XX")
Dim fp As StreamWriter
dim strfile as string = Server.MapPath("xml_news//")
strfile = strfile & i.tostring()
strfile = strfile & ".asp"
fp = File.CreateText(strfile)
fp.WriteLine("<p>" & Server.HtmlDecode(strPost)
& "</p>")
fp.close()
Catch ex As Exception
Response.Write(ex.Message() & "<br>")
End Try
i = i + 1
Next
Thanks for any help. -----Original Message----- The "replace" needs either two characters or two strings.
In your case, try: Dim c As Char = Chr(194) str = str.Replace(c.ToString, "")
Or why not just str.replace("Ã,", "")?
Bill
"anonymous" wrote:
Hello,
I need to replace this char Ã, with another char. However I am not able to acieve this. I tried this but
it doesnt work:
str = str.Replace(chr(asc(194)), "")
Can somebody help ? .
Try my code and you will see that the asp page contains
this character. -----Original Message----- I don't see any Âs in the feed? Is it really the
character you want to replace? cheers, mortb
"anonymous" <an*******@discussions.microsoft.com> wrote
in message news:46****************************@phx.gbl... I tried both versions, but it still doesnt work. The thing is that I am reading the following rss (http://pluralsight.com/blogs/dbox/Rss.aspx) and creating the file with the description of the item. The file contains only the description with the strange chars. Here is my complete code:
Dim reader As New XmlTextReader ("http://pluralsight.com/blogs/dbox/Rss.aspx") Dim xmlDoc As New XmlDocument
xmlDoc.Load(reader)
Dim nodes As XmlNodeList = xmlDoc.SelectNodes ("/rss/channel/item") dim i as integer = 0
For Each node As XmlNode In nodes Try strPost = node("description").InnerXml Dim c as char = Chr(194) strPost = strPost.Replace("Â", "XX") Dim fp As StreamWriter dim strfile as string = Server.MapPath("xml_news//") strfile = strfile & i.tostring() strfile = strfile & ".asp" fp = File.CreateText(strfile) fp.WriteLine("<p>" & Server.HtmlDecode(strPost) & "</p>") fp.close() Catch ex As Exception Response.Write(ex.Message() & "<br>") End Try i = i + 1 Next
Thanks for any help.
-----Original Message----- The "replace" needs either two characters or two strings. In your case, try: Dim c As Char = Chr(194) str = str.Replace(c.ToString, "")
Or why not just str.replace("Ã,", "")?
Bill
"anonymous" wrote:
Hello,
I need to replace this char Ã, with another char. However I am not able to acieve this. I tried this butit doesnt work:
str = str.Replace(chr(asc(194)), "")
Can somebody help ? .
.
I get exceptions when I run your code ("could not find a part of the path"),
but tracing through still don't see the  (e.g. strPost.IndexOf("Â") fails).
Is it possible you have a code page problem?
Bill
"anonymous" wrote: Try my code and you will see that the asp page contains this character.
-----Original Message----- I don't see any Âs in the feed? Is it really the character you want toreplace? cheers, mortb
"anonymous" <an*******@discussions.microsoft.com> wrote in messagenews:46****************************@phx.gbl... I tried both versions, but it still doesnt work. The thing is that I am reading the following rss (http://pluralsight.com/blogs/dbox/Rss.aspx) and creating the file with the description of the item. The file contains only the description with the strange chars. Here is my complete code:
Dim reader As New XmlTextReader ("http://pluralsight.com/blogs/dbox/Rss.aspx") Dim xmlDoc As New XmlDocument
xmlDoc.Load(reader)
Dim nodes As XmlNodeList = xmlDoc.SelectNodes ("/rss/channel/item") dim i as integer = 0
For Each node As XmlNode In nodes Try strPost = node("description").InnerXml Dim c as char = Chr(194) strPost = strPost.Replace("Â", "XX") Dim fp As StreamWriter dim strfile as string = Server.MapPath("xml_news//") strfile = strfile & i.tostring() strfile = strfile & ".asp" fp = File.CreateText(strfile) fp.WriteLine("<p>" & Server.HtmlDecode(strPost) & "</p>") fp.close() Catch ex As Exception Response.Write(ex.Message() & "<br>") End Try i = i + 1 Next
Thanks for any help.
-----Original Message----- The "replace" needs either two characters or two strings. In your case, try: Dim c As Char = Chr(194) str = str.Replace(c.ToString, "")
Or why not just str.replace("Ã,", "")?
Bill
"anonymous" wrote:
Hello,
I need to replace this char Ã, with another char. However I am not able to acieve this. I tried this but
it doesnt work:
str = str.Replace(chr(asc(194)), "")
Can somebody help ?
.
.
The A character only appear in the created file. Ofcourse
you need the change the path so that it works on your
system.
Please help. -----Original Message----- I get exceptions when I run your code ("could not find a
part of the path"), but tracing through still don't see the Ã, (e.g.
strPost.IndexOf("Ã,") fails). Is it possible you have a code page problem?
Bill
"anonymous" wrote:
Try my code and you will see that the asp page contains this character. >-----Original Message----- >I don't see any Ã,s in the feed? Is it really the character you want to >replace? >cheers, >mortb > >"anonymous" <an*******@discussions.microsoft.com>
wrote in message >news:46****************************@phx.gbl... >I tried both versions, but it still doesnt work. The
thing >is that I am reading the following rss >(http://pluralsight.com/blogs/dbox/Rss.aspx) and
creating >the file with the description of the item. The file >contains only the description with the strange chars.
Here >is my complete code: > >Dim reader As New XmlTextReader >("http://pluralsight.com/blogs/dbox/Rss.aspx") >Dim xmlDoc As New XmlDocument > >xmlDoc.Load(reader) > >Dim nodes As XmlNodeList = xmlDoc.SelectNodes >("/rss/channel/item") >dim i as integer = 0 > >For Each node As XmlNode In nodes >Try > strPost = node("description").InnerXml > Dim c as char = Chr(194) > strPost = strPost.Replace("Ã,", "XX") > Dim fp As StreamWriter > dim strfile as string = Server.MapPath
("xml_news//") > strfile = strfile & i.tostring() > strfile = strfile & ".asp" > fp = File.CreateText(strfile) > fp.WriteLine("<p>" & Server.HtmlDecode(strPost) >& "</p>") > fp.close() >Catch ex As Exception > Response.Write(ex.Message() & "<br>") >End Try >i = i + 1 >Next > >Thanks for any help. > >>-----Original Message----- >>The "replace" needs either two characters or two
strings. >In your case, try: >> >> Dim c As Char = Chr(194) >> str = str.Replace(c.ToString, "") >> >>Or why not just str.replace("Ãf,", "")? >> >>Bill >> >>"anonymous" wrote: >> >>> Hello, >>> >>> I need to replace this char Ãf, with another
char. >>> However I am not able to acieve this. I tried this
but >it >>> doesnt work: >>> >>> str = str.Replace(chr(asc(194)), "") >>> >>> Can somebody help ? >>> >>. >> > > >. > .
My dumb mistake on the path. Looks like the source has some nonbreaking
spaces ( ascii 160), which the htmldecode is turning into asc 194. I'm
guessing you could do your replace *after* the decode, else replace on 160
*before* the decode. As to why that space is not encoded, whereas, say, the
<'s are correctly converted to < etc., I don't know. Not sure if that happens
on the rss end, or maybe in your textreader. Anyway, I'm not familiar with
grabbing a feed the way you're doing it, so can't offer much more. Hopefully
this will get you going.
Bill
"Anonymous" wrote: The A character only appear in the created file. Ofcourse you need the change the path so that it works on your system.
Please help. -----Original Message----- I get exceptions when I run your code ("could not find a part of the path"),but tracing through still don't see the Ã, (e.g. strPost.IndexOf("Ã,") fails).Is it possible you have a code page problem?
Bill
"anonymous" wrote:
Try my code and you will see that the asp page contains this character.
>-----Original Message----- >I don't see any Ã,s in the feed? Is it really the character you want to >replace? >cheers, >mortb > >"anonymous" <an*******@discussions.microsoft.com> wrote in message >news:46****************************@phx.gbl... >I tried both versions, but it still doesnt work. The thing >is that I am reading the following rss >(http://pluralsight.com/blogs/dbox/Rss.aspx) and creating >the file with the description of the item. The file >contains only the description with the strange chars. Here >is my complete code: > >Dim reader As New XmlTextReader >("http://pluralsight.com/blogs/dbox/Rss.aspx") >Dim xmlDoc As New XmlDocument > >xmlDoc.Load(reader) > >Dim nodes As XmlNodeList = xmlDoc.SelectNodes >("/rss/channel/item") >dim i as integer = 0 > >For Each node As XmlNode In nodes >Try > strPost = node("description").InnerXml > Dim c as char = Chr(194) > strPost = strPost.Replace("Ã,", "XX") > Dim fp As StreamWriter > dim strfile as string = Server.MapPath ("xml_news//") > strfile = strfile & i.tostring() > strfile = strfile & ".asp" > fp = File.CreateText(strfile) > fp.WriteLine("<p>" & Server.HtmlDecode(strPost) >& "</p>") > fp.close() >Catch ex As Exception > Response.Write(ex.Message() & "<br>") >End Try >i = i + 1 >Next > >Thanks for any help. > >>-----Original Message----- >>The "replace" needs either two characters or two strings. >In your case, try: >> >> Dim c As Char = Chr(194) >> str = str.Replace(c.ToString, "") >> >>Or why not just str.replace("Ãf,", "")? >> >>Bill >> >>"anonymous" wrote: >> >>> Hello, >>> >>> I need to replace this char Ãf, with another char. >>> However I am not able to acieve this. I tried this but >it >>> doesnt work: >>> >>> str = str.Replace(chr(asc(194)), "") >>> >>> Can somebody help ? >>> >>. >> > > >. > .
Thanks man. That did the trick. I was replacing 194 before
encoding. Now I am replacing 160 before encoding and it
works like a charm. How did you know that it 160 before
encoding?
Thanks -----Original Message----- My dumb mistake on the path. Looks like the source has
some nonbreaking spaces ( ascii 160), which the htmldecode is turning
into asc 194. I'm guessing you could do your replace *after* the decode,
else replace on 160 *before* the decode. As to why that space is not encoded,
whereas, say, the <'s are correctly converted to < etc., I don't know. Not
sure if that happens on the rss end, or maybe in your textreader. Anyway, I'm
not familiar with grabbing a feed the way you're doing it, so can't offer
much more. Hopefully this will get you going.
Bill
"Anonymous" wrote:
The A character only appear in the created file.
Ofcourse you need the change the path so that it works on your system. Please help. >-----Original Message----- >I get exceptions when I run your code ("could not find
a part of the path"), >but tracing through still don't see the Ãf, (e.g. strPost.IndexOf("Ãf,") fails). >Is it possible you have a code page problem? > >Bill > >"anonymous" wrote: > >> Try my code and you will see that the asp page
contains >> this character. >> >> >> >> >> >-----Original Message----- >> >I don't see any Ãf,s in the feed? Is it really the >> character you want to >> >replace? >> >cheers, >> >mortb >> > >> >"anonymous" <an*******@discussions.microsoft.com> wrote >> in message >> >news:46****************************@phx.gbl... >> >I tried both versions, but it still doesnt work.
The thing >> >is that I am reading the following rss >> >(http://pluralsight.com/blogs/dbox/Rss.aspx) and creating >> >the file with the description of the item. The file >> >contains only the description with the strange
chars. Here >> >is my complete code: >> > >> >Dim reader As New XmlTextReader >> >("http://pluralsight.com/blogs/dbox/Rss.aspx") >> >Dim xmlDoc As New XmlDocument >> > >> >xmlDoc.Load(reader) >> > >> >Dim nodes As XmlNodeList = xmlDoc.SelectNodes >> >("/rss/channel/item") >> >dim i as integer = 0 >> > >> >For Each node As XmlNode In nodes >> >Try >> > strPost = node("description").InnerXml >> > Dim c as char = Chr(194) >> > strPost = strPost.Replace("Ãf,", "XX") >> > Dim fp As StreamWriter >> > dim strfile as string = Server.MapPath ("xml_news//") >> > strfile = strfile & i.tostring() >> > strfile = strfile & ".asp" >> > fp = File.CreateText(strfile) >> > fp.WriteLine("<p>" & Server.HtmlDecode(strPost) >> >& "</p>") >> > fp.close() >> >Catch ex As Exception >> > Response.Write(ex.Message() & "<br>") >> >End Try >> >i = i + 1 >> >Next >> > >> >Thanks for any help. >> > >> >>-----Original Message----- >> >>The "replace" needs either two characters or two strings. >> >In your case, try: >> >> >> >> Dim c As Char = Chr(194) >> >> str = str.Replace(c.ToString, "") >> >> >> >>Or why not just str.replace("Ãff,", "")? >> >> >> >>Bill >> >> >> >>"anonymous" wrote: >> >> >> >>> Hello, >> >>> >> >>> I need to replace this char Ãff, with
another char. >> >>> However I am not able to acieve this. I tried
this but >> >it >> >>> doesnt work: >> >>> >> >>> str = str.Replace(chr(asc(194)), "") >> >>> >> >>> Can somebody help ? >> >>> >> >>. >> >> >> > >> > >> >. >> > >> >. > .
P.S. There's a good article here you might find interesting: http://aspnet.4guysfromrolla.com/articles/031903-1.aspx
"Anonymous" wrote: The A character only appear in the created file. Ofcourse you need the change the path so that it works on your system.
Please help. -----Original Message----- I get exceptions when I run your code ("could not find a part of the path"),but tracing through still don't see the Ã, (e.g. strPost.IndexOf("Ã,") fails).Is it possible you have a code page problem?
Bill
"anonymous" wrote:
Try my code and you will see that the asp page contains this character.
>-----Original Message----- >I don't see any Ã,s in the feed? Is it really the character you want to >replace? >cheers, >mortb > >"anonymous" <an*******@discussions.microsoft.com> wrote in message >news:46****************************@phx.gbl... >I tried both versions, but it still doesnt work. The thing >is that I am reading the following rss >(http://pluralsight.com/blogs/dbox/Rss.aspx) and creating >the file with the description of the item. The file >contains only the description with the strange chars. Here >is my complete code: > >Dim reader As New XmlTextReader >("http://pluralsight.com/blogs/dbox/Rss.aspx") >Dim xmlDoc As New XmlDocument > >xmlDoc.Load(reader) > >Dim nodes As XmlNodeList = xmlDoc.SelectNodes >("/rss/channel/item") >dim i as integer = 0 > >For Each node As XmlNode In nodes >Try > strPost = node("description").InnerXml > Dim c as char = Chr(194) > strPost = strPost.Replace("Ã,", "XX") > Dim fp As StreamWriter > dim strfile as string = Server.MapPath ("xml_news//") > strfile = strfile & i.tostring() > strfile = strfile & ".asp" > fp = File.CreateText(strfile) > fp.WriteLine("<p>" & Server.HtmlDecode(strPost) >& "</p>") > fp.close() >Catch ex As Exception > Response.Write(ex.Message() & "<br>") >End Try >i = i + 1 >Next > >Thanks for any help. > >>-----Original Message----- >>The "replace" needs either two characters or two strings. >In your case, try: >> >> Dim c As Char = Chr(194) >> str = str.Replace(c.ToString, "") >> >>Or why not just str.replace("Ãf,", "")? >> >>Bill >> >>"anonymous" wrote: >> >>> Hello, >>> >>> I need to replace this char Ãf, with another char. >>> However I am not able to acieve this. I tried this but >it >>> doesnt work: >>> >>> str = str.Replace(chr(asc(194)), "") >>> >>> Can somebody help ? >>> >>. >> > > >. > .
Its a regular article about consuming rss. I do it the
same way. Thanks :) -----Original Message----- P.S. There's a good article here you might find
interesting: http://aspnet.4guysfromrolla.com/articles/031903-1.aspx
"Anonymous" wrote:
The A character only appear in the created file.
Ofcourse you need the change the path so that it works on your system. Please help. >-----Original Message----- >I get exceptions when I run your code ("could not find
a part of the path"), >but tracing through still don't see the Ãf, (e.g. strPost.IndexOf("Ãf,") fails). >Is it possible you have a code page problem? > >Bill > >"anonymous" wrote: > >> Try my code and you will see that the asp page
contains >> this character. >> >> >> >> >> >-----Original Message----- >> >I don't see any Ãf,s in the feed? Is it really the >> character you want to >> >replace? >> >cheers, >> >mortb >> > >> >"anonymous" <an*******@discussions.microsoft.com> wrote >> in message >> >news:46****************************@phx.gbl... >> >I tried both versions, but it still doesnt work.
The thing >> >is that I am reading the following rss >> >(http://pluralsight.com/blogs/dbox/Rss.aspx) and creating >> >the file with the description of the item. The file >> >contains only the description with the strange
chars. Here >> >is my complete code: >> > >> >Dim reader As New XmlTextReader >> >("http://pluralsight.com/blogs/dbox/Rss.aspx") >> >Dim xmlDoc As New XmlDocument >> > >> >xmlDoc.Load(reader) >> > >> >Dim nodes As XmlNodeList = xmlDoc.SelectNodes >> >("/rss/channel/item") >> >dim i as integer = 0 >> > >> >For Each node As XmlNode In nodes >> >Try >> > strPost = node("description").InnerXml >> > Dim c as char = Chr(194) >> > strPost = strPost.Replace("Ãf,", "XX") >> > Dim fp As StreamWriter >> > dim strfile as string = Server.MapPath ("xml_news//") >> > strfile = strfile & i.tostring() >> > strfile = strfile & ".asp" >> > fp = File.CreateText(strfile) >> > fp.WriteLine("<p>" & Server.HtmlDecode(strPost) >> >& "</p>") >> > fp.close() >> >Catch ex As Exception >> > Response.Write(ex.Message() & "<br>") >> >End Try >> >i = i + 1 >> >Next >> > >> >Thanks for any help. >> > >> >>-----Original Message----- >> >>The "replace" needs either two characters or two strings. >> >In your case, try: >> >> >> >> Dim c As Char = Chr(194) >> >> str = str.Replace(c.ToString, "") >> >> >> >>Or why not just str.replace("Ãff,", "")? >> >> >> >>Bill >> >> >> >>"anonymous" wrote: >> >> >> >>> Hello, >> >>> >> >>> I need to replace this char Ãff, with
another char. >> >>> However I am not able to acieve this. I tried
this but >> >it >> >>> doesnt work: >> >>> >> >>> str = str.Replace(chr(asc(194)), "") >> >>> >> >>> Can somebody help ? >> >>> >> >>. >> >> >> > >> > >> >. >> > >> >. > .
I just looked at the 194's, then went back to those same positions in the
original and found the 160's by dumping the ascii values of those strings. I
had also guessed it might be something with  's, which is always a decent
bet when something looks ok on the screen but your code chokes on it. Have
fun.
"Anonymous" wrote: Thanks man. That did the trick. I was replacing 194 before encoding. Now I am replacing 160 before encoding and it works like a charm. How did you know that it 160 before encoding?
Thanks
-----Original Message----- My dumb mistake on the path. Looks like the source has some nonbreakingspaces ( ascii 160), which the htmldecode is turning into asc 194. I'mguessing you could do your replace *after* the decode, else replace on 160*before* the decode. As to why that space is not encoded, whereas, say, the<'s are correctly converted to < etc., I don't know. Not sure if that happenson the rss end, or maybe in your textreader. Anyway, I'm not familiar withgrabbing a feed the way you're doing it, so can't offer much more. Hopefullythis will get you going.
Bill
"Anonymous" wrote:
The A character only appear in the created file. Ofcourse you need the change the path so that it works on your system.
Please help. >-----Original Message----- >I get exceptions when I run your code ("could not find a part of the path"), >but tracing through still don't see the Ãf, (e.g. strPost.IndexOf("Ãf,") fails). >Is it possible you have a code page problem? > >Bill > >"anonymous" wrote: > >> Try my code and you will see that the asp page contains >> this character. >> >> >> >> >> >-----Original Message----- >> >I don't see any Ãf,s in the feed? Is it really the >> character you want to >> >replace? >> >cheers, >> >mortb >> > >> >"anonymous" <an*******@discussions.microsoft.com> wrote >> in message >> >news:46****************************@phx.gbl... >> >I tried both versions, but it still doesnt work. The thing >> >is that I am reading the following rss >> >(http://pluralsight.com/blogs/dbox/Rss.aspx) and creating >> >the file with the description of the item. The file >> >contains only the description with the strange chars. Here >> >is my complete code: >> > >> >Dim reader As New XmlTextReader >> >("http://pluralsight.com/blogs/dbox/Rss.aspx") >> >Dim xmlDoc As New XmlDocument >> > >> >xmlDoc.Load(reader) >> > >> >Dim nodes As XmlNodeList = xmlDoc.SelectNodes >> >("/rss/channel/item") >> >dim i as integer = 0 >> > >> >For Each node As XmlNode In nodes >> >Try >> > strPost = node("description").InnerXml >> > Dim c as char = Chr(194) >> > strPost = strPost.Replace("Ãf,", "XX") >> > Dim fp As StreamWriter >> > dim strfile as string = Server.MapPath ("xml_news//") >> > strfile = strfile & i.tostring() >> > strfile = strfile & ".asp" >> > fp = File.CreateText(strfile) >> > fp.WriteLine("<p>" & Server.HtmlDecode(strPost) >> >& "</p>") >> > fp.close() >> >Catch ex As Exception >> > Response.Write(ex.Message() & "<br>") >> >End Try >> >i = i + 1 >> >Next >> > >> >Thanks for any help. >> > >> >>-----Original Message----- >> >>The "replace" needs either two characters or two strings. >> >In your case, try: >> >> >> >> Dim c As Char = Chr(194) >> >> str = str.Replace(c.ToString, "") >> >> >> >>Or why not just str.replace("Ãff,", "")? >> >> >> >>Bill >> >> >> >>"anonymous" wrote: >> >> >> >>> Hello, >> >>> >> >>> I need to replace this char Ãff, with another char. >> >>> However I am not able to acieve this. I tried this but >> >it >> >>> doesnt work: >> >>> >> >>> str = str.Replace(chr(asc(194)), "") >> >>> >> >>> Can somebody help ? >> >>> >> >>. >> >> >> > >> > >> >. >> > >> >. > .
Hey, wasn't regular to me--I learned all sorts of new things from your post,
thanks.
"Anonymous" wrote: Its a regular article about consuming rss. I do it the same way. Thanks :)
-----Original Message----- P.S. There's a good article here you might find interesting: http://aspnet.4guysfromrolla.com/articles/031903-1.aspx
"Anonymous" wrote:
The A character only appear in the created file. Ofcourse you need the change the path so that it works on your system.
Please help. >-----Original Message----- >I get exceptions when I run your code ("could not find a part of the path"), >but tracing through still don't see the Ãf, (e.g. strPost.IndexOf("Ãf,") fails). >Is it possible you have a code page problem? > >Bill > >"anonymous" wrote: > >> Try my code and you will see that the asp page contains >> this character. >> >> >> >> >> >-----Original Message----- >> >I don't see any Ãf,s in the feed? Is it really the >> character you want to >> >replace? >> >cheers, >> >mortb >> > >> >"anonymous" <an*******@discussions.microsoft.com> wrote >> in message >> >news:46****************************@phx.gbl... >> >I tried both versions, but it still doesnt work. The thing >> >is that I am reading the following rss >> >(http://pluralsight.com/blogs/dbox/Rss.aspx) and creating >> >the file with the description of the item. The file >> >contains only the description with the strange chars. Here >> >is my complete code: >> > >> >Dim reader As New XmlTextReader >> >("http://pluralsight.com/blogs/dbox/Rss.aspx") >> >Dim xmlDoc As New XmlDocument >> > >> >xmlDoc.Load(reader) >> > >> >Dim nodes As XmlNodeList = xmlDoc.SelectNodes >> >("/rss/channel/item") >> >dim i as integer = 0 >> > >> >For Each node As XmlNode In nodes >> >Try >> > strPost = node("description").InnerXml >> > Dim c as char = Chr(194) >> > strPost = strPost.Replace("Ãf,", "XX") >> > Dim fp As StreamWriter >> > dim strfile as string = Server.MapPath ("xml_news//") >> > strfile = strfile & i.tostring() >> > strfile = strfile & ".asp" >> > fp = File.CreateText(strfile) >> > fp.WriteLine("<p>" & Server.HtmlDecode(strPost) >> >& "</p>") >> > fp.close() >> >Catch ex As Exception >> > Response.Write(ex.Message() & "<br>") >> >End Try >> >i = i + 1 >> >Next >> > >> >Thanks for any help. >> > >> >>-----Original Message----- >> >>The "replace" needs either two characters or two strings. >> >In your case, try: >> >> >> >> Dim c As Char = Chr(194) >> >> str = str.Replace(c.ToString, "") >> >> >> >>Or why not just str.replace("Ãff,", "")? >> >> >> >>Bill >> >> >> >>"anonymous" wrote: >> >> >> >>> Hello, >> >>> >> >>> I need to replace this char Ãff, with another char. >> >>> However I am not able to acieve this. I tried this but >> >it >> >>> doesnt work: >> >>> >> >>> str = str.Replace(chr(asc(194)), "") >> >>> >> >>> Can somebody help ? >> >>> >> >>. >> >> >> > >> > >> >. >> > >> >. > .
This discussion thread is closed Replies have been disabled for this discussion. Similar topics
3 posts
views
Thread by Q. John Chen |
last post: by
|
7 posts
views
Thread by VMI |
last post: by
|
12 posts
views
Thread by Adam J. Schaff |
last post: by
|
15 posts
views
Thread by roberts.noah |
last post: by
|
35 posts
views
Thread by jacob navia |
last post: by
|
32 posts
views
Thread by FireHead |
last post: by
|
10 posts
views
Thread by vignesh4u |
last post: by
|
7 posts
views
Thread by DarthBob88 |
last post: by
|
4 posts
views
Thread by Paul Brettschneider |
last post: by
| | | | | | | | | | |