Bosse168Medlem sedan nov. 20031 018 inlägg Hur gör man för att göra en Replace så teckenet " blir "?
Har försökt med detta:
Function kontroll(text)
Text = TRIM(Text)
Text = server.HTMLEncode(Text)
Text = replace(Text, """, """)
Response.Write text
End Function
Men får detta fel mess:
Microsoft VBScript compilation error '800a0409'
Unterminated string constant
Text = replace(Text, """, """)
------------------------------^
Jag förstår att man inte kan ha " mellan själva replacen så hur skulle man smidigt lösa detta?
PoffeMedlem sedan apr. 20022 743 inlägg Antar attd et är enkelfnuttar du vill byta ut till? alltså två '
Text = replace(Text, """", "''")
Bosse168Medlem sedan nov. 20031 018 inlägg Nej jag vill byta ut " till "
PoffeMedlem sedan apr. 20022 743 inlägg Varför vill du byta ut ett citattcken till ett citattecken? Känns rätt dumt att byta ut nått till samma sak lixom
Bosse168Medlem sedan nov. 20031 018 inlägg Annars funkar inte Javascriptet.
cyprysMedlem sedan dec. 20003 563 inlägg *ops
Såhär då kanske?
Function kontroll(text)
Text = TRIM(Text)
Text = server.HTMLEncode(Text)
Text = replace(Text, """", "'")
Response.Write text
End Function
PoffeMedlem sedan apr. 20022 743 inlägg Men det är ju samma tecken du vill byta till?
Bosse168Medlem sedan nov. 20031 018 inlägg Löste det med
Replace(Rs("texten"),"""","& quot;")
Fast & quot; ihop
Bosse168Medlem sedan nov. 20031 018 inlägg Ahh såg att det gjorde om koden & q uot; (fast ihop ska det ju vara. :)
Bosse168Medlem sedan nov. 20031 018 inlägg Tackar för hjälpen är jag som är trött och missade o kolla mina inlägg :)