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]"

  • 2
    Trim is common to sound and video editting
    – Unrelated
    Apr 27, 2017 at 21:15
  • 2
    Can you give references for your statement that left-truncate seems to have another meaning in statistics?
    – MikeRoger
    Apr 28, 2017 at 9:15

8 Answers 8


Truncation can happen at either end:




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.

  • @jl6 "...off the top or the end." The top or the end in the array is the leftmost or the rightmost. So it's perfectly fine to use truncate for left or for right shortening of your array. I think in this case your understanding of the word is different from the meaning of the word (which happens to everyone with some words) - I would just adjust your understanding of what truncate means, given the above definition, and lose the hangup about only using it to refer to truncating when you remove from the end of something!
    – Gary
    Apr 27, 2017 at 22:28
  • @Gary Who are you replying to here? The author of this answer clearly writes: Truncation can happen at either end, so it is obvious that he does not have a "hangup" about it.
    – pipe
    Apr 27, 2017 at 22:30
  • @pipe Well I thought the @ that I started my comment with, made who I was writing to perfectly clear... That and the OP's original comment in their question: "but it doesn't feel right to use this word when removing array elements from the beginning."
    – Gary
    Apr 27, 2017 at 22:30
  • @Gary: I'm not convinced that the definition's phrasing "off the top or the end" implies "off the bottom or the beginning". Can you point to an example of truncation referring to the beginning or bottom rather than the top or end?
    – jl6
    Apr 27, 2017 at 22:51
  • @jl6 I can maybe do slightly better, here's an example pointing to truncation from left or right of an array :) internoetics.com/2016/06/24/…
    – Gary
    Apr 27, 2017 at 22:54

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)

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)


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.

  • I had the same thought. "Prepend" and "Postpend" are relatively recent terms though. I think the traditional terms are "prefix" and "append" Apr 27, 2017 at 21:57
  • I too, thinking of prepend and prefix, looked up precate, but that's not a real word, I'm afraid. Apr 27, 2017 at 22:20

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


Trim is what we call it over here where I live in the computer.

  • 2
    Trim is usually applied to both sides, not just the beginning.
    – Glorfindel
    Apr 28, 2017 at 10:50
  • so adapt, use 'left trim'
    – JMP
    Apr 29, 2017 at 5:41

I think the proper word based on Latin roots should be "precise" as a verb. But, the adjective form and noun "precision" have hidden some of the root meaning it seems, so that many no longer could use "precise" (pronounced like 'pre-size') as a verb.

I would use precise myself and relish in the real core root meaning being resurrected, but one may compound pre and delete for a quick manifest understanding:

predelete or pre-delete

you could even pronounce it like 'pred-elite'.


Replying to necro-thread I came across while looking for the same question.

I recommend fruncate, for "front truncate". I think anyone reading that in code will immediately understand what it does:

char* new_str = fruncate(orig_str, 10);

I believe none of the other options presented above really get to the heart of the question:

  • trim - trim is almost always short for "trim whitespace", generally trims both ends, normally does not take a positional parameter, and probably already exists in whatever libraries you might be using. It's really nothing like truncate and using it in this alternative meaning would likely be confusing to anyone else reading the code.

  • slice - slice is another good option, as those libs that offer a single-position version generally use it for the starting point - consider BASIC's MID$(A$,10) which means "everything from char 10 on".

  • drop - I consider this to be more confusing that useful, drop has many existing uses in various APIs that mean "delete this object". The usage shown is much more commonly known as "remove" which I think is far less confusing.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.