Libraryless. Click here for Pure Java version (2718L/16K).
static S joinStrings(S sep, O... strings) { ret joinStrings(sep, Arrays.asList(strings)); } static S joinStrings(S sep, Iterable strings) { new StringBuilder buf; for (O o : unnull(strings)) { S s = strOrNull(o); if (nempty(s)) { if (nempty(buf)) buf.append(sep); buf.append(s); } } ret str(buf); }
download show line numbers debug dex old transpilations
Travelled to 16 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ekrmjmnbrukm, gjtlkbvenryc, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1006693 |
Snippet name: | joinStrings - join non-empty strings with separator |
Eternal ID of this version: | #1006693/3 |
Text MD5: | 6d8a3fa6509928170495ce186c8f1223 |
Transpilation MD5: | e089f4c08ae45f59a109c57a354f63ba |
Author: | stefan |
Category: | javax / gui |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-01-04 04:15:15 |
Source code size: | 348 bytes / 15 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 511 / 966 |
Version history: | 2 change(s) |
Referenced in: | #1006654 - Standard functions list 2 (LIVE, continuation of #761) #1010636 - joinNempties - synonym of joinStrings - join non-empty strings with separator |