20.2 Obtaining the Atomic Number from an Atomic Symbol

The inverse of OEGetAtomicSymbol, i.e. obtaining the atomic numbers from an atomic symbol, is performed by OEChem's OEGetAtomicNum function. This function takes an const char* argument and returns an unsigned integer representing the atomic number. All the returned string values for OEGetAtomicSymbol are legitimate inputs. Additionally, the atomic symbol is terminated by either a NUL character, '\0', or a space. Empty symbols (of length zero) or symbols longer than two characters return the value zero. The one or two characters of the symbol are considered case insensitive (i.e. the first character converted to uppercase, and the second, if it exists, converted to lower case for matching). The symbols ``D'' and ``T'' (representing deuterium and tritium) return the value one (for hydrogen). If the atomic symbol isn't recognized a value of zero is returned. OEGetAtomicNum always returns a value less than OEElemNo::MAXELEM.