string aa = abc(a b c)aaa
int firstIndex = 0;
int endIndex = 0;
firstIndex = aa.IndexOf("(");//定位(位置
endIndex = aa.IndexOf(")");//定位)位置
string tmpStr = "";
string ReportTmpStr = "";
ReportTmpStr = aa;
if (firstIndex >= 0 && endIndex >= 0)
{
tmpStr = ReportTmpStr.Substring(firstIndex, endIndex + 1);//擷取出(a b c)
string ReportTmpStr2 = tmpStr.Replace(" ", "");//取代空格
ReportTmpStr = ReportTmpStr.Replace(tmpStr, ReportTmpStr2);
}