public void RemoveprimaryKey()
{
string domainName = System.Configuration.ConfigurationSettings.AppSettings["domainName"];
string userName = System.Configuration.ConfigurationSettings.AppSettings["userName"];
string passowrd = System.Configuration.ConfigurationSettings.AppSettings["passowrd"];
timestamp = DateTime.Now.ToString("dd:MM:yy h:mm:ss tt").Replace(":", "_").Replace(" ", "");
string content = string.Empty;
string primaryIndustry = "primaryIndustry";
client = CoreServiceClientFactory.GetClient();
string[] tcmList = System.IO.File.ReadAllLines(Environment.CurrentDirectory + "\\" + "PrimaryIndustry.txt");
string[] tcmSaved = System.IO.File.ReadAllLines(Environment.CurrentDirectory + "\\log1\\" + "componentListsaved.txt");
foreach (var tcmid in tcmList.Except(tcmSaved))
{
ComponentData ComponentContent = null;
try
{
ComponentContent = client.Read(tcmid, new ReadOptions()) as ComponentData;
}
catch (Exception ex)
{
ComponentContent = null;
}
if (ComponentContent != null && ComponentContent.Content.Contains(primaryIndustry))
{
content = ComponentContent.Content;
//content = content.Replace(subIndustry, secondaryIndustries);
//content = content.Replace(primaryIndustry, null);
// string str2 = content.Substring(content.IndexOf("<primaryIndustry"), content.IndexOf("</primaryIndustry>") - content.IndexOf("<primaryIndustry") + 18);
//string result2 = str2.Remove(content.IndexOf("<primaryIndustry"), content.IndexOf("</primaryIndustry>"));
string str1 = content.Substring(0, content.IndexOf("<primaryIndustry"));
string str4 = content.Substring(0,content.IndexOf("</primaryIndustry"));
content = str1 + str4;
ComponentContent.Content = content;
}
here i need to remove Primary Industry tagged Keyword