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

8
LINES

< > BotCompany Repo | #1015294 // fileExtension - including dot. uses only last extension if there are multiple

JavaX fragment (include)

static S fileExtension(File f) {
  if (f == null) null;
  ret fileExtension(f.getName());
}

static S fileExtension(S s) {
  ret substring(s, smartLastIndexOf(s, '.'));
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1015294
Snippet name: fileExtension - including dot. uses only last extension if there are multiple
Eternal ID of this version: #1015294/5
Text MD5: 54247dbc04b4c92ae91ef3928eedc980
Author: stefan
Category: javax / io
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-05-29 21:48:01
Source code size: 177 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 432 / 482
Version history: 4 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1016313 - fileExtensionWithoutDot