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

5
LINES

< > BotCompany Repo | #1035036 // dropAfterLastSlashOrEmpty - also drops the slash

JavaX fragment (include)

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

Author comment

Began life as a copy of #1007058

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1035036
Snippet name: dropAfterLastSlashOrEmpty - also drops the slash
Eternal ID of this version: #1035036/1
Text MD5: 7ec22c54b12b510f885a94ae06c7d0c6
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-03-25 18:34:27
Source code size: 140 bytes / 5 lines
Pitched / IR pitched: No / No
Views / Downloads: 56 / 70
Referenced in: [show references]