Libraryless. Click here for Pure Java version (2143L/14K).
1 | static LS words2_plusApostrophe(S s) { |
2 | new L<S> l; |
3 | int n = l(s); |
4 | for (int i = 0; i < n; ) { |
5 | int j = i; |
6 | while (j < n && isLetterOrDigitOrApostrophe(s.charAt(j))) |
7 | ++j; |
8 | if (j > i) l.add(substring(s, i, j)); |
9 | while (j < n && !isLetterOrDigitOrApostrophe(s.charAt(j))) |
10 | ++j; |
11 | i = j; |
12 | } |
13 | ret l; |
14 | } |
Began life as a copy of #1008045
download show line numbers debug dex old transpilations
Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1025782 |
Snippet name: | words2_plusApostrophe - deeply extract all words (and numbers) from string |
Eternal ID of this version: | #1025782/1 |
Text MD5: | a6fa7bb426cb9195b7346d70da9d5951 |
Transpilation MD5: | a945681a3c03927a29423ad4d2d32022 |
Author: | stefan |
Category: | javax / parsing |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-10-19 19:29:29 |
Source code size: | 340 bytes / 14 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 223 / 319 |
Referenced in: | [show references] |