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).

1  
static void removeLast(L l) {
2  
  if (!l.isEmpty())
3  
    l.remove(l(l)-1);
4  
}
5  
6  
static void removeLast(L l, int n) {
7  
  removeSubList(l, l(l)-n);
8  
}
9  
10  
svoid removeLast(int n, L l) {
11  
  removeLast(l, n);
12  
}
13  
14  
svoid removeLast(StringBuilder buf) {
15  
  if (buf == null) ret;
16  
  int n = buf.length();
17  
  if (n > 0) buf.setLength(n-1);
18  
}

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: 692 / 1335
Version history: 3 change(s)
Referenced in: [show references]