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

11
LINES

< > BotCompany Repo | #1022864 // find2_range - returns range(C, N)

JavaX fragment (include)

static IntRange find2_range(S pat, LS tok) {
  ret find2_range(parse3(pat), tok);
}

static IntRange find2_range(LS pat, LS tok) {
  for (int idx = 0; idx < tok.size(); idx += 2) {
    S[] result = find2(pat, tok, idx);
    if (result != null) ret intRange(idx, idx+l(pat)-2);
  }
  null;
}

Author comment

Began life as a copy of #1022863

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1022864
Snippet name: find2_range - returns range(C, N)
Eternal ID of this version: #1022864/1
Text MD5: aa13bc2ad645ced8d833eac2c85f3adf
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-04-11 23:03:15
Source code size: 300 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 235 / 278
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)