Implement substring and slice.