Update substring.cpp