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

17
LINES

< > BotCompany Repo | #1031454 // findAllTagsNamed

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

Libraryless. Click here for Pure Java version (2828L/17K).

1  
// tok = parsed with htmlTok
2  
static LS findAllTagsNamed(LS tok, S tag) {
3  
  new LS out;
4  
  for (int i = 1; i < l(tok); i += 2)
5  
    if (isTag(tok.get(i), tag))
6  
      out.add(tok.get(i));
7  
  ret out;
8  
}
9  
10  
static LS mapMethodLike findAllTagsNamed(S tag, LS tok) {
11  
  ret findAllTagsNamed(tok, tag);
12  
}
13  
14  
// Note the reversed parameters
15  
static LS mapMethodLike findAllTagsNamed(S tag, S html) {
16  
  ret findAllTagsNamed(htmlTok(html), tag);
17  
}

Author comment

Began life as a copy of #1009190

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1031454
Snippet name: findAllTagsNamed
Eternal ID of this version: #1031454/1
Text MD5: 17d6cec81d47cf1d387c5a70545aab2d
Transpilation MD5: 004a5bebe21f9d4f354e835173dd1d4c
Author: stefan
Category: javax / html
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-06-14 00:25:48
Source code size: 444 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 168 / 233
Referenced in: [show references]