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

6
LINES

< > BotCompany Repo | #1012342 // charIndexOfRow (both counting from 0)

JavaX fragment (include)

1  
static int charIndexOfRow(S text, int row) {
2  
  int i = 0;
3  
  while (row-- > 0 && i < l(text))
4  
    i = smartIndexOf(text, '\n', i)+1;
5  
  ret min(i, l(text));
6  
}

Author comment

Began life as a copy of #1008636

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: #1012342
Snippet name: charIndexOfRow (both counting from 0)
Eternal ID of this version: #1012342/5
Text MD5: bf31bc14c54595a3ae1163e05d5987b9
Author: stefan
Category: javax / parsing
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-11-28 15:55:43
Source code size: 161 bytes / 6 lines
Pitched / IR pitched: No / No
Views / Downloads: 369 / 420
Version history: 4 change(s)
Referenced in: [show references]