Libraryless. Click here for Pure Java version (9472L/52K).
static String[] drop(int n, String[] a) { n = Math.min(n, a.length); String[] b = new String[a.length-n]; System.arraycopy(a, n, b, 0, b.length); return b; } static Object[] drop(int n, Object[] a) { n = Math.min(n, a.length); Object[] b = new Object[a.length-n]; System.arraycopy(a, n, b, 0, b.length); return b; } static <A> L<A> drop(Iterable<A> c, O pred) { ret antiFilter(c, pred); } static L lambdaMapLike drop(O pred, Iterable c) { ret antiFilter(pred, c); } static L drop(O pred, O[] c) { ret antiFilter(pred, c); } static <A, B extends A> L<B> drop(Iterable<B> c, F1<A, Bool> pred) { ret antiFilter(c, pred); } static <A, B extends A> L<B> drop(F1<A, Bool> pred, Iterable<B> c) { ret antiFilter(pred, c); } static <A, B extends A> L<B> drop(Iterable<B> c, IF1<A, Bool> pred) { ret antiFilter(c, pred); } static <A, B extends A> L<B> drop(IF1<A, Bool> pred, Iterable<B> c) { ret antiFilter(pred, c); }
download show line numbers debug dex old transpilations
Travelled to 17 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ekrmjmnbrukm, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mowyntqkapby, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, uelavcdoioby, vouqrxazstgt
No comments. add comment
Snippet ID: | #1000705 |
Snippet name: | drop function (drop first elements of array, also antiFilter) |
Eternal ID of this version: | #1000705/4 |
Text MD5: | 32e0ab3ad3a6e01b51bd22d9ad5fc9ce |
Transpilation MD5: | eec5716d1a3eb5d98b61ccd852173f08 |
Author: | stefan |
Category: | |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-10-27 01:31:54 |
Source code size: | 1011 bytes / 53 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 727 / 1350 |
Version history: | 3 change(s) |
Referenced in: | #1000719 - dropLast function (drop last elements of array/list/string) #1000798 - dropFirst function (drop first elements of array or chars of string - synonym of "drop") #1002427 - Accellerating 629 (SPIKE) #1006654 - Standard functions list 2 (LIVE, continuation of #761) #3000382 - Answer for ferdie (>> t = 1, f = 0) |