Controlled switching of optical emission energies in semiconducting single-walled carbon nanotubes.