webForumDet fria alternativet
Logga in / Bli medlem

mellanslag i replace

ASP

3 svar · 191 visningar · startad av skatan

Medlem sedan sep. 200126 inlägg
Trådstart#1

jag vill ha så när man slår ett mellanslag blir det en bild, men det vill inte riktigt funka för mig

Function meny(strText)
strText = Server.HTMLEncode(strText)
strText = Replace (strText,"s","<img src='s.gif'>")
strText = Replace (strText,"k","<img src='k.gif'>")
strText = Replace (strText,"a","<img src='a.gif'>")
strText = Replace (strText,"t","<img src='t.gif'>")
strText = Replace (strText,"n","<img src='n.gif'>")
strText = Replace (strText,"|","<img src='meny-block.gif'>")
strText = Replace (strText," ","<img src='mellanslag.gif'>")
strText = TRIM(strText)
meny = strText

Medlem sedan juni 200032 967 inlägg
#2

På vilket sätt fungerar det inte?

Medlem sedan sep. 200126 inlägg
#3

Problemet är

Fast det är för att du först kanske byter ut ett s mot s.gif med
<img src='s.gif'>

o sen kommer ett mellanslag vilket gör att <img src='s.gif'> blir
<img<img src='mellanslag.gif'>src='s.gif'>

förstår du?

Medlem sedan sep. 200126 inlägg
#4

Fick fixat de! Tack ändå

274 ms totalt · 4 externa anrop · v20260731065814-full.51f67c91
123 ms — deklarationer (db)
0 ms — hämta statistik (cache)
142 ms — hämta tråd, inlägg och bilagor (db)
130 ms — ändringar (db)