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

7
LINES

< > BotCompany Repo | #1029778 // dropUriPrefix

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

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

1  
sS dropUriPrefix(S prefix, S uri) {
2  
  prefix = dropTrailingSlash(prefix);
3  
  if (empty(prefix)) ret uri;
4  
  if (eq(uri, prefix) || startsWith(uri, prefix + "/"))
5  
    ret substring(uri, l(prefix));
6  
  ret uri;
7  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1029778
Snippet name: dropUriPrefix
Eternal ID of this version: #1029778/1
Text MD5: fc9609ddeda883697e8499dccbd9db6f
Transpilation MD5: 809e10ac72bedf4c7ad11292c8af9e77
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-09-14 12:33:42
Source code size: 213 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 169 / 227
Referenced in: [show references]