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

3
LINES

< > BotCompany Repo | #1002048 // dropSuffix - note the (maybe) curious argument order

JavaX fragment (include)

static S dropSuffix(S suffix, S s) {
  ret nempty(suffix) && endsWith(s, suffix) ? s.substring(0, l(s)-l(suffix)) : s;
}

download  show line numbers  debug dex  old transpilations   

Travelled to 37 computer(s): aoiabmzegqzx, ayivmpnvhhik, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, ekrmjmnbrukm, elmgxqgtpvxh, gjtlkbvenryc, gwrvuhgaqvyk, hpgrupgrauku, ishqpsrjomds, jcllbfdqhrgy, jozkyjcghlvl, jtubtzbbkimh, lnbujpyubztb, lpdgvwnxivlt, lqnftawlhpir, mowyntqkapby, mqqgnosmbjvj, mqsvbyillbrs, nazvggbglmsf, ofpaelxlmzfo, omdjrrnzbjjv, onxytkatvevr, podlckwnjdmb, ppjhyzlbdabe, pyentgdyhuwx, pzhvpgtvlbxg, sawdedvomwva, snaazhdonpnp, tslmcundralx, tvejysmllsmz, vouqrxazstgt, whxojlpjdney, wnsclhtenguj, xrpafgyirdlv

No comments. add comment

Snippet ID: #1002048
Snippet name: dropSuffix - note the (maybe) curious argument order
Eternal ID of this version: #1002048/3
Text MD5: c05e0e8f13136b1b9121ac50b6bede5e
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-09-22 21:29:59
Source code size: 122 bytes / 3 lines
Pitched / IR pitched: No / No
Views / Downloads: 719 / 11434
Version history: 2 change(s)
Referenced in: #1002110 - dropPrefix
#1002427 - Accellerating 629 (SPIKE)
#1003026 - dropSuffixIgnoreCase
#1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1010559 - dropSuffixIC - note the (maybe) curious argument order
#1013609 - actuallyDropSuffix - fails when suffix not there
#3000382 - Answer for ferdie (>> t = 1, f = 0)