add obtain string's substring aglorithm