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

7
LINES

< > BotCompany Repo | #1004440 // lastLine - get last line of text

JavaX fragment (include)

// TODO: optimize
static S lastLine(S s) {
  s = dropSuffix("\n", s);
  s = dropSuffix("\r", s);
  int i = s.lastIndexOf('\n');
  ret substring(s, i+1);
}

download  show line numbers  debug dex  old transpilations   

Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1004440
Snippet name: lastLine - get last line of text
Eternal ID of this version: #1004440/1
Text MD5: 9ead742040e9cd8e212b698325ce428b
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-08-17 00:11:34
Source code size: 160 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 545 / 552
Referenced in: [show references]