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

11
LINES

< > BotCompany Repo | #1001922 // numberLines

JavaX fragment (include)

static S numberLines(S text) {
  ret numberLines(toLines(text));
}

static S numberLines(L<S> lines) {
  new StringBuilder buf;
  int i = 1;
  for (S s : lines)
    buf.append((i++) + ". " + s + "\n");
  ret str(buf);
}

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: #1001922
Snippet name: numberLines
Eternal ID of this version: #1001922/1
Text MD5: d13de19b166260eface524efe0a3e9fa
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-10-26 16:06:43
Source code size: 229 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 787 / 972
Referenced in: #1002427 - Accellerating 629 (SPIKE)
#1006654 - Standard functions list 2 (LIVE, continuation of #761)
#3000382 - Answer for ferdie (>> t = 1, f = 0)
#3000383 - Answer for funkoverflow (>> t=1, f=0 okay)