String 如何在salesforce中使用apex从字符串中删除“

String 如何在salesforce中使用apex从字符串中删除“,string,salesforce,apex,String,Salesforce,Apex,我有一根像下面这样的线 String str ='<table height="400" width="600" cellpadding="5" border="0" cellspacing="5" > <tr height="50" valign="top" > <td style=" color:#000000; font-size:12pt; background-color:#FFFFFF; font-family:arial; bLabel:main;

我有一根像下面这样的线

  String str ='<table height="400" width="600" cellpadding="5" border="0" cellspacing="5" > <tr height="50" valign="top" > <td style=" color:#000000; font-size:12pt; background-color:#FFFFFF; font-family:arial; bLabel:main; bEditID:r3st1;" tEditID="c1r1" locked="0" aEditID="c1r1" > <![CDATA[<div><br></div><div>hi&nbsp;Rajib1 maity1,</div>this is your header<div><br></div>]]></td> </tr> <tr height="300" valign="top" > <td style=" color:#000000; font-size:12pt; background-color:#FFFFFF; font-family:arial; bLabel:main; bEditID:r3st1;" tEditID="c1r2" locked="0" aEditID="c1r2" > <![CDATA[&nbsp;<div><div>hi&nbsp;Rajib1 maity1,</div>this is your body</div>]]></td> </tr> <tr height="50" valign="top" > <td style=" color:#000000; font-size:12pt; background-color:#FFFFFF; font-family:arial; bLabel:main; bEditID:r3st1;" tEditID="c1r3" locked="0" aEditID="c1r3" > <![CDATA[<div><br></div><div><div>hi&nbsp;Rajib1 maity1,</div>this is your footer</div>]]></td> </tr> </table>';
我想删除以下作品

str = str.replaceAll('<!\\[CDATA\\[', ''); // replace '<![CDATA['
str= str.replaceAll('\\]\\]>', ''); // replace ']]'
str = str.replaceAll('\\<![CDATA[','');
str = str.replaceAll('\\<]]','');
str = str.replaceAll('<!\\[CDATA\\[', ''); // replace '<![CDATA['
str= str.replaceAll('\\]\\]>', ''); // replace ']]'