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

11
LINES

< > BotCompany Repo | #1016335 // dropLastFromObjectArray

JavaX fragment (include)

static O[] dropLastFromObjectArray(O[] a) {
  ret dropLastFromObjectArray(a, 1);
}

static O[] dropLastFromObjectArray(O[] a, int n) {
  if (a == null) null;
  n = Math.min(n, a.length);
  O[] b = new O[a.length-n];
  System.arraycopy(a, 0, b, 0, b.length);
  ret b;
}

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: 308 / 348
Version history: 1 change(s)
Referenced in: [show references]