Adding idxsubstr.cpp