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

6
LINES

< > BotCompany Repo | #1016963 // dropGlobalID - drop "[id: dfjsfdsf]" suffix; also rtrims

JavaX fragment (include)

static S dropGlobalID(S s) {
  s = rtrim(s);
  if (!endsWith(s, "]")) ret s;
  Matcher m = regexpMatcher("\\[id: [a-z]{" + globalIDLength() + "}\\]$", s);
  ret m.find() ? rtrim(takeFirst(regexpMatcherIndex(m), s)) : s;
}

Author comment

Began life as a copy of #1016960

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1016963
Snippet name: dropGlobalID - drop "[id: dfjsfdsf]" suffix; also rtrims
Eternal ID of this version: #1016963/6
Text MD5: ad95adb711d1935f643505b25d114cf7
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-07-28 17:50:40
Source code size: 226 bytes / 6 lines
Pitched / IR pitched: No / No
Views / Downloads: 352 / 373
Version history: 5 change(s)
Referenced in: [show references]