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

14
LINES

< > BotCompany Repo | #1000641 // toLinesFullTrim - trim all lines, drop empty ones, return as list of lines

JavaX fragment (include)

static List<String> toLinesFullTrim(String s) {
  ifdef tlft_debug
    print("tlft called on " + l(s) + " chars");
  endifdef
  new L<S> l;
  for (S line : toLines(s)) if (nempty(line = trim(line))) l.add(line);
  ret l;
}

static L<S> toLinesFullTrim(File f) {
  new L<S> l;
  for (S line : linesFromFile(f)) if (nempty(line = trim(line))) l.add(line);
  ret l;
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1000641
Snippet name: toLinesFullTrim - trim all lines, drop empty ones, return as list of lines
Eternal ID of this version: #1000641/6
Text MD5: 1910c9820de7088d739f2d9c5da51b56
Author: stefan
Category:
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-03-16 17:14:55
Source code size: 379 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 828 / 2812
Version history: 5 change(s)
Referenced in: #1001560 - fullTrim
#1002427 - Accellerating 629 (SPIKE)
#1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1007820 - firstLineFullTrim
#1008942 - tlft - synonym of toLinesFullTrim
#1022556 - tlft_iterator - tlft as iterator
#3000382 - Answer for ferdie (>> t = 1, f = 0)