Quote (") character inside a string

Get help using Construct 2

Post » Fri May 31, 2013 10:07 pm

I'm trying to do a replace function on a string that contains HTML code, for example:

<TEXTFORMAT LEADING="2"><P ALIGN="CENTER"><FONT FACE="Arial" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">My Sample Text</FONT></P></TEXTFORMAT>


I'm trying to remove the formatting so I'm running the Replace command:

replace(Text, Find, Replace)

Unfortunately it won't let me use this because of the " characters in the string. In javascript I would just use single quotes around the string, or use backslashes in front of the " chars but Construct doesn't seem to allow either of these options. Is there a workaround for this?

B
6
S
1
Posts: 8
Reputation: 703

Post » Fri May 31, 2013 10:23 pm

Escape with "" eg:

text = "<p align=""center"">"
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,680

Post » Fri May 31, 2013 10:24 pm

Thanks!
B
6
S
1
Posts: 8
Reputation: 703


Return to How do I....?

Who is online

Users browsing this forum: BiffanyPFH and 29 guests