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

15
LINES

< > BotCompany Repo | #1003800 - endsWith

JavaX fragment (include)

static bool endsWith(S a, S b) {
  ret a != null && a.endsWith(b);
}

static bool endsWith(S a, char c) {
  ret nempty(a) && lastChar(a) == c;
}

ifclass Matches
  static bool endsWith(S a, S b, Matches m) {
    if (!endsWith(a, b)) false;
    m.m = new S[] {dropLast(l(b), a)};
    true;
  }
endif

download  show line numbers  debug dex   

Travelled to 11 computer(s): aoiabmzegqzx, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, tslmcundralx, tvejysmllsmz

No comments. add comment

Snippet ID: #1003800
Snippet name: endsWith
Eternal ID of this version: #1003800/4
Text MD5: 1703271ef2b9bffcc505645fe6d4d289
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-06-13 03:46:34
Source code size: 314 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 323 / 362
Version history: 3 change(s)
Referenced in: [show references]