Converts an iterable to a string.
(
Iterable<T> iterable, String start, String sep, String end)
| 1494 | * Converts an iterable to a string. |
| 1495 | */ |
| 1496 | public static <T> String toString( |
| 1497 | Iterable<T> iterable, String start, String sep, String end) { |
| 1498 | final StringBuilder buf = new StringBuilder(); |
| 1499 | buf.append(start); |
| 1500 | for (Ord<T> ord : Ord.zip(iterable)) { |
| 1501 | if (ord.i > 0) { |
| 1502 | buf.append(sep); |
| 1503 | } |
| 1504 | buf.append(ord.e); |
| 1505 | } |
| 1506 | buf.append(end); |
| 1507 | return buf.toString(); |
| 1508 | } |
| 1509 | |
| 1510 | /** Converts a list of strings to a string separated by newlines. */ |
| 1511 | public static String lines(Iterable<String> strings) { |
no test coverage detected