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

11
LINES

< > BotCompany Repo | #1010088 // tok_sameTest - compare list of tokens with joined text

JavaX fragment (include)

1  
static bool tok_sameTest(L<S> tok, S text) {
2  
  int iTok = 0, iText = 0, nTok = l(tok), nText = l(text);
3  
  while (iTok < nTok) {
4  
    S t = tok.get(iTok++);
5  
    int n = l(t);
6  
    if (n == 0) continue;
7  
    if (!t.regionMatches(0, text, iText, n)) false;
8  
    iText += n;
9  
  }
10  
  ret iText == nText;
11  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1010088
Snippet name: tok_sameTest - compare list of tokens with joined text
Eternal ID of this version: #1010088/1
Text MD5: 8596171fd567067041b45c076e8765a8
Author: stefan
Category: javax / parsing
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-09-02 10:05:05
Source code size: 304 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 500 / 489
Referenced in: [show references]