Java Utililty Methods String Join

List of utility methods to do String Join

Description

The list of methods to do String Join are organized into topic(s).

Method

Stringjoin(String separator, String... parts)
Join an arry of strings into a single using the specified delimiter.
StringBuilder builder = new StringBuilder();
for (String part : parts) {
    if (builder.length() > 0) {
        builder.append(separator);
    builder.append(part);
return builder.toString();
...
Stringjoin(String separator, String... strings)
todo: move to common module
if (strings == null) {
    return null;
StringBuilder sb = new StringBuilder();
for (int i = 0; i < strings.length; i++) {
    Object o = strings[i];
    if (i > 0) {
        sb.append(separator);
...
Stringjoin(String separator, String... strings)
join
StringBuilder sb = new StringBuilder();
if (strings.length > 0) {
    sb.append(strings[0]);
for (int i = 1; i < strings.length; i++) {
    sb.append(separator).append(strings[i]);
return sb.toString();
...
Stringjoin(String splitter, String... strs)
join
return join(splitter, Arrays.asList(strs));
Stringjoin(String str[], String splitter)
join
StringBuilder b = new StringBuilder();
b.append(str[0]);
for (int i = 1, len = str.length; i < len; i++) {
    b.append(splitter).append(str[i]);
return b.toString().trim();
Stringjoin(String... paths)
join
return join(SLASH_CHAR, paths);
Stringjoin(String... xs)
join
StringBuilder sb = new StringBuilder();
for (String x : xs)
    sb.append(x);
return sb.toString();
Stringjoin(T delimiter, List list)
join
StringBuilder sb = new StringBuilder();
for (int i = 0; i < list.size(); i++) {
    sb.append(list.get(i));
    if (i <= list.size() - 1)
        sb.append(delimiter);
return sb.toString();
Stringjoin2(String connector, String... strs)
join
StringBuffer sBuffer = new StringBuffer();
for (Object object : strs) {
    sBuffer.append(object).append(connector);
if (sBuffer.length() > 0) {
    sBuffer.delete(sBuffer.length() - connector.length(), sBuffer.length());
return sBuffer.toString();
...
StringjoinColumns(Iterable columns)
Joins the provided columns of data together with tab characters.
return String.join("\t", columns);