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

6
LINES

< > BotCompany Repo | #1015095 // lineNrToCharIndex - user-land line numbers (counting from 1)

JavaX fragment (include)

static int lineNrToCharIndex(S s, int lineNr) {
  int i = 0;
  while (--lineNr > 0)
    i = smartIndexOf(s, '\n', i)+1;
  ret i;
}

Author comment

Began life as a copy of #1005051

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: #1015095
Snippet name: lineNrToCharIndex - user-land line numbers (counting from 1)
Eternal ID of this version: #1015095/1
Text MD5: 5d24c2fc61bd0784da1a561e0e3424fa
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-05-08 12:12:26
Source code size: 135 bytes / 6 lines
Pitched / IR pitched: No / No
Views / Downloads: 309 / 348
Referenced in: [show references]