Forums
This topic is locked
replacing characters........
Posted 17 Oct 2001 17:27:58
1
has voted
17 Oct 2001 17:27:58 Jon Kerbey posted:
Does anyone know how to replace characters in Ultradev? I know how to replace a line break with a "<BR>" i.e.
<%=Replace((rsSectorForum.Fields.Item("sectorDetails".Value), Chr(13), "<br>"%>
But how is it possible to replace other characters, such as an apostrophe ('), because at the moment this causes the insert forms to function incorrectly.
On a slightly more advanced note, how can I make it wasy for ppl to insert urls? At the moment they have to write out "<a href=....." etc. Does anyone know how to code the insert url function like this forum has?
thanks in advance
Replies
Replied 18 Oct 2001 00:36:53
18 Oct 2001 00:36:53 Joel Martinez replied:
the replace is simple, just use the same syntax you're already using...
for the database insert issue, just use
<b>replace(thefield, "'","''"</b>
that replaces single quotes with double quotes (which will fix that issue)
as far as the url insert code... that could take a bit more time than I have right now, but I can give you pseudo-code, and you can maybe figure it out from there?<pre id=code><font face=courier size=2 id=code>1. find the <b>IndexOf()</b> of the value ""
2. then take that, and find the <b>IndexOf()</b> of the next space after that (by starting from the point of the http.
3. then take the <b>subString()</b> between the two points, and use that value to <b>replace()</b> the string you just got, with <a href="<b>thestring[b]">[b]thestring</b></a></font id=code></pre id=code>now I know this is an ultradev forum, but I don't know of an extension that would do that (would be mighty cool though), and I'm going home...
Joel Martinez [ ]
----------
E-Commerce Concepts with Ultradev...pre-order yours at
www.basic-ultradev.com/ecomm_concepts/
for the database insert issue, just use
<b>replace(thefield, "'","''"</b>
that replaces single quotes with double quotes (which will fix that issue)
as far as the url insert code... that could take a bit more time than I have right now, but I can give you pseudo-code, and you can maybe figure it out from there?<pre id=code><font face=courier size=2 id=code>1. find the <b>IndexOf()</b> of the value ""
2. then take that, and find the <b>IndexOf()</b> of the next space after that (by starting from the point of the http.
3. then take the <b>subString()</b> between the two points, and use that value to <b>replace()</b> the string you just got, with <a href="<b>thestring[b]">[b]thestring</b></a></font id=code></pre id=code>now I know this is an ultradev forum, but I don't know of an extension that would do that (would be mighty cool though), and I'm going home...
Joel Martinez [ ]
----------
E-Commerce Concepts with Ultradev...pre-order yours at
www.basic-ultradev.com/ecomm_concepts/