string formula = "H2O"; string element = "H"; string newFormula = ChemicalFormula.Remove(formula, element); // newFormula is "O"
string formula = "C6H5COOH"; string group = "COOH"; string newFormula = ChemicalFormula.Remove(formula, group); // newFormula is "C6H5"Based on the method name and its functionality, it is likely that the ChemicalFormula.Remove() method belongs to a package library related to chemistry, such as the ChemSharp library.