Java Collection Join join(Collection strings, String sep)

Here you can find the source of join(Collection strings, String sep)

Description

join

License

Apache License

Declaration

public static String join(Collection<String> strings, String sep) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.Collection;

public class Main {
    public static String join(Collection<String> strings, String sep) {
        StringBuilder buf = new StringBuilder();
        for (String str : strings) {
            buf.append(sep).append(str);
        }//from   w ww.j ava2s  .  c  o m
        return buf.substring(sep.length());
    }
}

Related

  1. join(Collection strings, String delimiter)
  2. join(Collection strings, String delimiter)
  3. join(Collection strings, String delimiter)
  4. join(Collection strings, String delimiter)
  5. join(Collection strings, String sep)
  6. join(Collection strings, String separator)
  7. join(Collection strings, String separator)
  8. join(Collection strings, String token)
  9. join(Collection strs, String sep)