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


< > BotCompany Repo | #1013805 - replaceExtension

JavaX fragment (include)

static File replaceExtension(File f, S extOld, S extNew) {
  ret newFile(replaceExtension(f2s(f), extOld, extNew));

static File replaceExtension(File f, S extNew) {
  ret replaceExtension(f, fileExtension(f), extNew);

static S replaceExtension(S s, S extOld, S extNew) {
  s = dropSuffixIC(addPrefixOptIfNempty(".", extOld), s);
  ret s + addPrefixOptIfNempty(".", extNew);

static S replaceExtension(S name, S extNew) {
  ret replaceExtension(name, fileExtension(name), extNew);

Author comment

Began life as a copy of #1011103

download  show line numbers  debug dex   

Travelled to 17 computer(s): aoiabmzegqzx, ayivmpnvhhik, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, whxojlpjdney, xrpafgyirdlv

No comments. add comment

Snippet ID: #1013805
Snippet name: replaceExtension
Eternal ID of this version: #1013805/10
Text MD5: acf1b36c10f22f545cb095182f841fc9
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-07-27 22:04:59
Source code size: 504 bytes / 16 lines
Pitched / IR pitched: No / No
Views / Downloads: 308 / 1260
Version history: 9 change(s)
Referenced in: [show references]

Formerly at &