public static string getElemComp(string tableElemComp, int indexX, int indexY, int indexZ) { string ElemCompOut; ElemCompOut = tableElemComp.Replace("x", indexX.ToString()); ElemCompOut = ElemCompOut.Replace("y", indexY.ToString()); return(ElemCompOut); }
public static string getElemCompFA(string tableElemComp, int indexX, int indexY, int indexZ) { string ElemCompOut; int faHydrogens = (indexX - indexY) * 2; ElemCompOut = tableElemComp.Replace("(x-y)*2", faHydrogens.ToString()); ElemCompOut = ElemCompOut.Replace("x", indexX.ToString()); ElemCompOut = ElemCompOut.Replace("y", indexY.ToString()); ElemCompOut = ElemCompOut.Replace("z", indexZ.ToString()); ElemCompOut = ElemCompOut.Replace(" + ", ""); ElemCompOut = ElemCompOut.Replace("*", ""); return(ElemCompOut.ToUpper()); }