Revealing the Relationship between Energy Level and Gas Sensing Performance in Heteroatom-Doped Semiconducting Nanostructures.