webForumDet fria alternativet

mellanslag i replace

3 svar · 189 visningar · startad av skatan

skatanMedlem sedan sep. 200126 inlägg
#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

@ndersMedlem sedan juni 200032 969 inlägg
#2

På vilket sätt fungerar det inte?

skatanMedlem 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?

skatanMedlem sedan sep. 200126 inlägg
#4

Fick fixat de! Tack ändå

126 ms totalt · 3 externa anrop · v20260731065814-full.30151723
0 ms — hämta forumlista (cache)
0 ms — hämta statistik (cache)
124 ms — hämta tråd, inlägg och bilagor (db)