Horizontal join of multiline strings
17023
def _hjoin_multiline(join_char, strings):
    
    cstrings = [string.split("\n") for string in strings]
    max_num_lines = max(len(item) for item in cstrings)
    pp = []
    for k in range(max_num_lines):
        p = [cstring[k] for cstring in cstrings]
        pp.append(join_char + join_char.join(p) + join_char)

    return "\n".join([p.rstrip() for p in pp])
953228
public static String join(Collection<String> s, String delimiter) {
        return join(s, delimiter, false);
    }
210194
public static String join (String[] values, String sep)
    {
        return StringUtil.join(values, sep);
    }
681063
def string_join_using_or_conjunction(strings)
      ret = ""
      strings.each_with_index do |str, i|
        case i
        when 0 # 最初の要素
        when strings.size - 1 # 最後の要素
          ret << " or "
        else
          ret << ", "
        end

        ret << str
      end

      ret
    end
435122
public static String join(Collection strings, String delimiter) {
        StringBuilder builder = new StringBuilder();
        Iterator<String> iter = strings.iterator();
        while (iter.hasNext()) {
            builder.append(iter.next());
            if (!iter.hasNext()) {
                break;
            }
            builder.append(delimiter);
        }
        return builder.toString();
    }
389570
private static String _join(String[] tokens, boolean excludeLast)
    {
        StringBuilder join = new StringBuilder();
        int length = tokens.length - (excludeLast ? 1 : 0);
        for (int i = 0; i < length; i++)
        {
            join.append(tokens[i]).append("/");
        }

        return join.toString();
    }
1137115
public static String join(String _delimiter, List<String> _strings) {
        if (_strings == null) {
            return null;
        }
        if (_delimiter == null) {
            _delimiter = "";
        }
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < _strings.size(); i++) {
            sb.append(_strings.get(i));
            if (i < _strings.size() - 1) { // only append delimiter if this is not the last token
                sb.append(_delimiter);
            }
        }
        return sb.toString();
    }
1262677
public static String joinStrings( String separator, String... strings ) {
        if (separator == null) {
            separator = "";
        }
        StringBuilder sb = new StringBuilder();
        for( int i = 0; i < strings.length; i++ ) {
            sb.append(strings[i]);
            if (i < strings.length - 1) {
                sb.append(separator);
            }
        }
        return sb.toString();
    }
940672
def multiline_input():
    """"""
    lines = []
    while True:
        try:
            lines.append(input())
        except EOFError:
            break

    return "\n".join(lines).strip()
706561
public static String joinStrings(List<String> strings, boolean fixCase, char withChar) {
        if (strings == null || strings.size() == 0) {
            return "";
        }
        StringBuilder result = null;
        for (String s : strings) {
            if (fixCase) {
                s = fixCase(s);
            }
            if (result == null) {
                result = new StringBuilder(s);
            } else {
                result.append(withChar);
                result.append(s);
            }
        }
        return result.toString();
    }
891917
def all_substrings(s):
    '''  '''
    join = ''.join
    for i in range(1, len(s) + 1):
        for sub in window(s, i):
            yield join(sub)
441921
def horizontal_line(self,
                        y: Union[int, float],
                        x1: Union[int, float],
                        x2: Union[int, float],
                        emphasize: bool = False
                        ) -> None:
        """"""
        x1, x2 = sorted([x1, x2])
        self.horizontal_lines.append(_HorizontalLine(y, x1, x2, emphasize))
907479
private static String join(long[] a) {
    assert (a.length > 0);
    StringBuilder builder = new StringBuilder();
    builder.append(a[0]);
    for (int i = 1; i < a.length; ++i) {
      builder.append(',');
      builder.append(a[i]);
    }
    return builder.toString();
  }
221379
def join_strings(key, value, fmt, meta):  # pylint: disable=unused-argument
    """"""
    if key in ['Para', 'Plain']:
        _join_strings(value)
    elif key == 'Image':
        _join_strings(value[-2])
    elif key == 'Table':
        _join_strings(value[-5])
233397
def _join_inlines(self, soup):
        
        elements = soup.find_all(True)
        for elem in elements:
            if self._inline(elem):
                elem.unwrap()
        return soup
848875
def print_horizontal_line(line, separator, widths)
      puts widths.map { |width| line * width }.join(separator)
    end
1129966
def chunks_str(str, n, separator="\n", fill_blanks_last=True):
    
    return separator.join(chunks(str, n))