public static String join(String glue, Iterable<String> strings) { StringBuilder buf = new StringBuilder(); Iterator<String> i = strings.iterator(); if (i.hasNext()) { buf.append(i.next()); while (i.hasNext()) buf.append(glue).append(i.next()); } return buf.toString(); }
Snippet is not live.
Travelled to 12 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #2000504 |
Snippet name: | join function |
Eternal ID of this version: | #2000504/1 |
Text MD5: | 90ff8a0580f06573e208950b92da1b84 |
Author: | stefan |
Category: | |
Type: | New Tinybrain snippet |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2015-08-09 02:41:48 |
Source code size: | 324 bytes / 10 lines |
Pitched / IR pitched: | No / Yes |
Views / Downloads: | 704 / 169 |
Referenced in: | #2000507 - join function + array version #3000382 - Answer for ferdie (>> t = 1, f = 0) |