Crops a sequence to a given length.