H
Hels Bells
Hi,
I'm looking to do some manipulation on a string containing html code
in asp which will involve me either using some regular expressions or
just plain old simple replace functionality. The text that I want to
use will have double quotes in it (as it's xhtml code) so I can't set
it as a string value and is actually brought into the page from a
content managed element (the details of which I don't think I'll need
to go into but needless to say it produces some valid xhtml)
What I want to be able to do is
<%
sTest = Replace("<a href="#">test link</a>", "<", "<")
Response.Write (sTest)
%>
This will obviously give a syntax error because of the double quotes
surrounding the href attribute. The first parameter isn't built up
from other strings in the code before but is pulled directly from a
fixed content management system element which I can't format any other
way. So I can't do
<%
s1 = "<a href="#">test link</a>"
sTest = Replace(s1, "<", "<")
Response.Write sTest
%>
I need the result of this replace to then be put into an xml attribute
so I need to convert the < > and " characters to < > and "
respectively.
Anyone have any ideas of how I could get this to work?
Many thanks
I'm looking to do some manipulation on a string containing html code
in asp which will involve me either using some regular expressions or
just plain old simple replace functionality. The text that I want to
use will have double quotes in it (as it's xhtml code) so I can't set
it as a string value and is actually brought into the page from a
content managed element (the details of which I don't think I'll need
to go into but needless to say it produces some valid xhtml)
What I want to be able to do is
<%
sTest = Replace("<a href="#">test link</a>", "<", "<")
Response.Write (sTest)
%>
This will obviously give a syntax error because of the double quotes
surrounding the href attribute. The first parameter isn't built up
from other strings in the code before but is pulled directly from a
fixed content management system element which I can't format any other
way. So I can't do
<%
s1 = "<a href="#">test link</a>"
sTest = Replace(s1, "<", "<")
Response.Write sTest
%>
I need the result of this replace to then be put into an xml attribute
so I need to convert the < > and " characters to < > and "
respectively.
Anyone have any ideas of how I could get this to work?
Many thanks