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

11
LINES

< > BotCompany Repo | #1029468 // charIteratorToString_max

JavaX fragment (include)

sS charIteratorToString_max(CharacterIterator it, int max) {
  if (it == null) null;
  new StringBuilder buf;
  while (max-- > 0 && it.hasNext())
    buf.append(it.next());
  ret str(buf);
}

sS charIteratorToString_max(int max, CharacterIterator it) {
  ret charIteratorToString_max(it, max);
}

Author comment

Began life as a copy of #1029463

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: #1029468
Snippet name: charIteratorToString_max
Eternal ID of this version: #1029468/3
Text MD5: 8843c11f6f1d79175b43a4bc9097a2b5
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-08-13 14:46:01
Source code size: 301 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 134 / 182
Version history: 2 change(s)
Referenced in: [show references]