Libraryless. Click here for Pure Java version (234L/2K).
1 | static ItIt<Int> lineStartIndexesIterator(S s) {
|
2 | ret new ItIt<Int> {
|
3 | int i; |
4 | |
5 | public bool hasNext() {
|
6 | ret i >= 0; |
7 | } |
8 | |
9 | public Int next() {
|
10 | int j = i; |
11 | i = indexOf(s, '\n', i); |
12 | if (i >= 0) ++i; |
13 | ret j; |
14 | } |
15 | }; |
16 | } |
Began life as a copy of #1005051
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
| Snippet ID: | #1035127 |
| Snippet name: | lineStartIndexesIterator |
| Eternal ID of this version: | #1035127/1 |
| Text MD5: | 6e5ccea4b708ae0e9d7f447bd951d3e9 |
| Transpilation MD5: | 3e8916ff70eea67cbed38340ccf64f9f |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2022-03-30 18:12:39 |
| Source code size: | 279 bytes / 16 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 315 / 394 |
| Referenced in: | [show references] |