What is a word that means truncate from the beginning?

I am creating some software that has the concept of truncating a one-dimensional array from either the left or right end. I'm happy using the word truncate to describe lopping off the rightmost end of the array, but it doesn't feel right to use this word when removing array elements from the beginning.

I've considered left-truncate but that seems to have another meaning in statistics.

"I've (left-truncated) the array [1,2,3,4,5] and am left with [3,4,5]"


Solution 1:

Truncation can happen at either end:

Truncate

VERB

[WITH OBJECT]

often as adjective truncated

1 Shorten (something) by cutting off the top or the end.

‘a truncated cone shape’

‘discussion was truncated by the arrival of tea’

If you really wanted a different word, you might consider Prune or Trim, but they don't have the meaning of "at the beginning."

I suspect you'll need to specify which end you're truncating.

Solution 2:

In many libraries, this is called drop.

> 1 to 10 
res1: Range.Inclusive = Range(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
> res1.drop(4) 
res2: Range = Range(5, 6, 7, 8, 9, 10)

Solution 3:

For the specific case of an array shift or slice may be what you want.

For arrays, a shift removes the first element of an array in Javascript and Ruby.

Slice means to return part of an array. It has no affinity toward the beginning or the end, so it may be suited for your purpose as long as you give the example. It typically expects a "start" index argument and an optional "end" argument index (end of array by default).

['a','b','c','d'].slice(1) => ['b','c','d']
['a','b','c','d'].slice(1,3) => ['b','c']

Slice is available in Javascript, Python, and Ruby (though my rep is too low to post links to these)

Solution 4:

For some reason, your title mentions the word opposite in meaning but the body of your question does not. What's up?

The meaning I get from "truncate" is to shorten an object by cutting part of it away from one or both of its ends.

Therefore, the word opposite in meaning would be to prepend or to postpend, depending upon which end one has in mind.

Solution 5:

If you are returning a new datastructure rather than modifying the source one in-place, then I have seen this operation be called Skip.

For example in .NET: https://msdn.microsoft.com/en-us/library/bb358985(v=vs.110).aspx