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

12
LINES

< > BotCompany Repo | #1029258 // substringObject

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

Libraryless. Click here for Pure Java version (2662L/17K).

static Substring substringObject(CharSequence s, int x) {
  ret substringObject(s, x, l(s));
}

static Substring substringObject(CharSequence s, int x, int y) {
  if (s == null) null;
  if (x < 0) x = 0;
  if (x > s.length()) x = s.length();
  if (y < x) y = x;
  if (y > s.length()) y = s.length();
  ret new Substring(s, x, y);
}

Author comment

Began life as a copy of #1002637

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1029258
Snippet name: substringObject
Eternal ID of this version: #1029258/3
Text MD5: 817ec0fd4b456b397ec4e6ed66c3aaeb
Transpilation MD5: 56f9c467b80fce398ed2cf586d00e4ce
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-07-27 18:24:03
Source code size: 342 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 147 / 227
Version history: 2 change(s)
Referenced in: [show references]