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

11
LINES

< > BotCompany Repo | #1035336 // tokenRangeLongerThanNChars

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

Libraryless. Click here for Pure Java version (117L/1K).

sbool tokenRangeLongerThanNChars(LS tok, int iStart, int iEnd, int maxChars) {
  int nChars = 0, n = l(tok);
  iStart = Math.max(0, iStart);
  iEnd = Math.min(n, iEnd);
  for (int i = iStart; i < iEnd; i++) {
    nChars += l(tok.get(i));
    if (nChars > maxChars)
      true;
  }
  false;
}

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1035336
Snippet name: tokenRangeLongerThanNChars
Eternal ID of this version: #1035336/1
Text MD5: d656c681d48a739c040248d03ab9f8fa
Transpilation MD5: f5760de8a4cbcfbdb6f77f8618736fe5
Author: stefan
Category: javax / tokenizing
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-05-01 17:55:55
Source code size: 301 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 156 / 185
Referenced in: [show references]