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

15
LINES

< > BotCompany Repo | #1003800 // endsWith

JavaX fragment (include)

1  
static bool endsWith(S a, S b) {
2  
  ret a != null && a.endsWith(b);
3  
}
4  
5  
static bool endsWith(S a, char c) {
6  
  ret nempty(a) && lastChar(a) == c;
7  
}
8  
9  
ifclass Matches
10  
  static bool endsWith(S a, S b, Matches m) {
11  
    if (!endsWith(a, b)) false;
12  
    m.m = new S[] {dropLast(l(b), a)};
13  
    true;
14  
  }
15  
endif

download  show line numbers  debug dex  old transpilations   

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

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: 774 / 1441
Version history: 3 change(s)
Referenced in: [show references]