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

12
LINES

< > BotCompany Repo | #1029174 // substringFromCharArray

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

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

sS substringFromCharArray(char[] s, int x) {
  ret substringFromCharArray(s, x, l(s));
}

sS substringFromCharArray(char[] s, int x, int y) {
  if (s == null) null;
  if (x < 0) x = 0;
  if (x >= s.length) ret "";
  if (y < x) y = x;
  if (y > s.length) y = s.length;
  ret new S(s, x, y-x);
}

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: #1029174
Snippet name: substringFromCharArray
Eternal ID of this version: #1029174/1
Text MD5: 55837c9d7c8e2ae259ce413910b0d0bf
Transpilation MD5: a5c2007efe55cc4f7025cd30221946c6
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-07-23 20:16:36
Source code size: 304 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 236 / 313
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)