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

8
LINES

< > BotCompany Repo | #1030495 // eqOptSlash - eq allowing an optional trailing slash on left or right

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (2707L/16K).

sbool eqOptSlash(S a, S b) {
  int n = lCommonPrefix(a, b);
  int la = l(a), lb = l(b);
  if (n == la && n == lb) true;
  if (n == lb && n == la-1 && lastChar(a) == '/') true;
  if (n == la && n == lb-1 && lastChar(b) == '/') true;
  false;
}

Author comment

Began life as a copy of #1013545

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1030495
Snippet name: eqOptSlash - eq allowing an optional trailing slash on left or right
Eternal ID of this version: #1030495/1
Text MD5: ce1168f319b0a532e0d19f03310f2dbb
Transpilation MD5: 64a7ab62a7e42ee32a822d3d303aa5d5
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-12-28 03:43:39
Source code size: 249 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 180 / 268
Referenced in: [show references]