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 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ekrmjmnbrukm, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, 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: 535 / 2429
Version history: 5 change(s)
Referenced in: [show references]

Formerly at http://tinybrain.de/1000641 & http://1000641.tinybrain.de