Escape slashes in a formula

Hi, I’m trying to use a formula field to combine the rollup of HTML table rows with a table header. I have added slackes in front of the quotation marks to escape them and wonder how to treat the slashes that close the HTML tags?

<p><table border=\"1\" cellspacing=\"0\" cellpadding=\"3\">
<tbody>
<tr>
<td style=\"background-color: #bebebe; text-align: center;\"><strong>Date</strong></td>
<td style=\"background-color: #bebebe; text-align: center;\"><strong>Nights</strong></td>
<td style=\"background-color: #bebebe; text-align: center;\"><strong>Host</strong></td>
<td style=\"background-color: #bebebe; text-align: center;\"><strong>Location</strong></td>
<td style=\"background-color: #bebebe; text-align: center;\"><strong>Phone</strong></td>
</tr>

Those are forward slashes, so you shouldn’t need to escape those.

1 Like

It’s possible that escaping only the double quote could get you into trouble. What if the HTML contained single quotes?

Are you showing the formula or the result of the formula?
What you display doesn’t quite look like either one.

In general, slashes and quotes are both escaped with a preceding slash: \\ for a slash, and \" for a quote.

1 Like