Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

11
LINES

< > BotCompany Repo | #1016335 // dropLastFromObjectArray

JavaX fragment (include)

1  
static O[] dropLastFromObjectArray(O[] a) {
2  
  ret dropLastFromObjectArray(a, 1);
3  
}
4  
5  
static O[] dropLastFromObjectArray(O[] a, int n) {
6  
  if (a == null) null;
7  
  n = Math.min(n, a.length);
8  
  O[] b = new O[a.length-n];
9  
  System.arraycopy(a, 0, b, 0, b.length);
10  
  ret b;
11  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1016335
Snippet name: dropLastFromObjectArray
Eternal ID of this version: #1016335/2
Text MD5: 82db024fb7a642829dc119a3c27816ca
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-06-15 15:27:32
Source code size: 280 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 386 / 421
Version history: 1 change(s)
Referenced in: [show references]