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

5
LINES

< > BotCompany Repo | #1007058 // dropAfterLastSlash - also drops the slash

JavaX fragment (include)

static S dropAfterLastSlash(S s) {
  if (s == null) null;
  int i = s.lastIndexOf('/');
  ret i < 0 ? s : rtrim(substring(s, 0, i));
}

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: #1007058
Snippet name: dropAfterLastSlash - also drops the slash
Eternal ID of this version: #1007058/3
Text MD5: 2e030ad4a9e888b407fa9e04263fc75f
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-06-15 18:14:59
Source code size: 138 bytes / 5 lines
Pitched / IR pitched: No / No
Views / Downloads: 493 / 504
Version history: 2 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1007368 - dropAfterFirstColon - drops the colon too
#1009075 - dropFromLastSlash - synonym of dropAfterLastSlash - also drops the slash
#1009894 - afterLastSlash
#1016109 - dropAfterSlash - also drops the slash & rtrims
#1035036 - dropAfterLastSlashOrEmpty - also drops the slash