Tailoring the Optoelectronic Properties of Carbon Nanotubes