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

11
LINES

< > BotCompany Repo | #1025706 // countAsteriskTokens

JavaX fragment (include)

1  
static int countAsteriskTokens(LS tok) {
2  
  int count = 0, n = l(tok);
3  
  for (int i = 1; i < n; i += 2)
4  
    if (eq(tok.get(i), "*"))
5  
      ++count;
6  
  ret count;
7  
}
8  
9  
static int countAsteriskTokens(S s) {
10  
  ret countOccurrences("*", javaTokC(s));
11  
}

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: #1025706
Snippet name: countAsteriskTokens
Eternal ID of this version: #1025706/3
Text MD5: edf4542fbb360d29d0a14a7db31438c8
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-03-23 15:42:01
Source code size: 254 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 206 / 258
Version history: 2 change(s)
Referenced in: [show references]