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

8
LINES

< > BotCompany Repo | #1036632 // extractNonNegativeIntsFromString

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

Libraryless. Click here for Pure Java version (10768L/59K).

static BigInteger[] extractNonNegativeIntsFromString(S s) {
  Pattern p = compileRegexp("\\d+");
  Matcher m = p.matcher(s);
  new L<BigInteger> list;
  while (m.find())
    list.add(new BigInteger(m.group()));
  return list.toArray(new BigInteger[list.size()]);
}

Author comment

Began life as a copy of #1003068

download  show line numbers  debug dex  old transpilations   

Travelled to 2 computer(s): mqqgnosmbjvj, wnsclhtenguj

No comments. add comment

Snippet ID: #1036632
Snippet name: extractNonNegativeIntsFromString
Eternal ID of this version: #1036632/1
Text MD5: bbc273946eca0dab908273d17177798b
Transpilation MD5: 5b0978761b82f419a07b36922b9fff22
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2023-07-08 01:24:28
Source code size: 271 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 63 / 89
Referenced in: [show references]