1 | // TODO: optimize |
2 | static S lastLine(S s) { |
3 | s = dropSuffix("\n", s); |
4 | s = dropSuffix("\r", s); |
5 | int i = s.lastIndexOf('\n'); |
6 | ret substring(s, i+1); |
7 | } |
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: | 608 / 619 |
Referenced in: | [show references] |