public void RemoveAtEndTest() { string line = "1-methylpentyl"; string away = "pentyl"; string stripped = UtilStrings.RemoveAtEnd(line, away); StringAssert.AreEqualIgnoringCase("1-methyl", stripped); }
public IUPACCompound(int locationOnParent, string name) { string chainDescription = FindSubChainPart(name); int chainLength = CarbonSubChain.FindSubChainLength(chainDescription); string remaining = UtilStrings.RemoveAtEnd(name, chainDescription); List <int> doubleBondLocations, tripleBondLocations; GetDoubleAndTripleBondLocations(name, out doubleBondLocations, out tripleBondLocations); Formula = new Formula(Enums.ChainTypes.Straight, locationOnParent, chainLength, doubleBondLocations, tripleBondLocations, remaining); }