Tuning the Optical Bandgap of Semiconducting Two-Dimensional Materials by Different Techniques