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

8
LINES

< > BotCompany Repo | #1031855 // spliceObjectArray - take out part and put in something new. note: second int is TO, not LENGTH

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (2989L/17K).

static O[] spliceObjectArray(O[] a, int from, int to, O[] b) {
  int lA = l(a), lB = l(b);
  O[] newArray = new[lA-(to-from)+lB];
  copyArray(a, 0, newArray, 0, from);
  copyArray(b, 0, newArray, from, lB);
  copyArray(a, to, newArray, from+lB, lA-from);
  ret newArray;
}

Author comment

Began life as a copy of #1026315

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx

No comments. add comment

Snippet ID: #1031855
Snippet name: spliceObjectArray - take out part and put in something new. note: second int is TO, not LENGTH
Eternal ID of this version: #1031855/1
Text MD5: 6773a7c391cad9e163ac239f4449be21
Transpilation MD5: f4cf78569521d74034674b32e07e327f
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-07-16 06:32:42
Source code size: 279 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 158 / 222
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)