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

18
LINES

< > BotCompany Repo | #1002305 // removeLast

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

Libraryless. Click here for Pure Java version (171L/2K).

static void removeLast(L l) {
  if (!l.isEmpty())
    l.remove(l(l)-1);
}

static void removeLast(L l, int n) {
  removeSubList(l, l(l)-n);
}

svoid removeLast(int n, L l) {
  removeLast(l, n);
}

svoid removeLast(StringBuilder buf) {
  if (buf == null) ret;
  int n = buf.length();
  if (n > 0) buf.setLength(n-1);
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1002305
Snippet name: removeLast
Eternal ID of this version: #1002305/4
Text MD5: 0075caba8bd19ae8e3db110e2011476f
Transpilation MD5: 07d7b0db05a0da25dea3193e577586ba
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-07-01 06:41:37
Source code size: 334 bytes / 18 lines
Pitched / IR pitched: No / No
Views / Downloads: 691 / 1334
Version history: 3 change(s)
Referenced in: #1002427 - Accellerating 629 (SPIKE)
#1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1030048 - removeLastKey
#1032651 - removeLastAndReturnList
#3000382 - Answer for ferdie (>> t = 1, f = 0)
#3000383 - Answer for funkoverflow (>> t=1, f=0 okay)