字符串“<img src="data:image\&#39; contains &#39;\&#39;

时间:2017-02-07 19:42:39

标签: salesforce force.com

<p>The following code gives me an error because the final character for the first string contains '\'</p> <p>How do I fix this?</p> <pre><code>myLog.EmailHTML__c.replaceAll('<img src=" data:image\',="" '<img="" src="data:image/'); </code></pre>

1 个答案:

答案 0 :(得分:2)

不使用单个'\',而是使用双'\'

myLog.EmailHTML__c.replaceAll('<img src="data:image\\', '<img src="data:image/');

希望它会起作用!!