Algorithm of extracting substring pos=2, len=3 pos=5, len=4 in ty in finity 超出 posten -1 pos+ -1 curLen-l ≥ curlenAlgorithm of extracting substring pos+len -1 pos+len -1 curLen-1 curLen i n f i n i t y i n f i n i t y pos = 2, len = 3 pos = 5, len = 4 f i n i t y 超出