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

10
LINES

< > BotCompany Repo | #1002768 // findImports - use tok_findImports instead!

JavaX fragment (include)

static List<String> findImports(String src) {
  List<String> imports = new ArrayList<String>();
  Pattern pattern = Pattern.compile("^\\s*import\\s+(.*?)\\s*;");
  for (String line : toLines(src)) {
    Matcher matcher = pattern.matcher(line);
    if (matcher.find())
      imports.add(matcher.group(1));
  }
  return imports;
}

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: #1002768
Snippet name: findImports - use tok_findImports instead!
Eternal ID of this version: #1002768/3
Text MD5: 625a8a51cd73d9d5309cac28be4a5a2b
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-09-02 14:06:17
Source code size: 337 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 691 / 1598
Version history: 2 change(s)
Referenced in: [show references]