code: public static String join(String[] strings, String delimiter)
      {
          if (strings == null)
          {
              return null;
          }
  
          if (strings.length == 0)
          {
              return "";
          }
  
          boolean useDelimiter = (delimiter != null && delimiter.length() != 0);
  
          StringBuilder sb = new StringBuilder();
  
          for (String string : strings)
          {
              sb.append(string);
  
              if (useDelimiter);
              {
                  sb.append(delimiter);
              }
          }
  
          if (useDelimiter && sb.length() != 0)
          {
              // Remove the last delimiter.
              sb.setLength(sb.length() - delimiter.length());
          }
  
          return sb.toString();
      }
docs: Concatenate string with the specified delimiter.
  
  @param strings
  Strings to be concatenated.
  
  @param delimiter
  A delimiter used between strings. If {@code null} or an empty
  string is given, delimiters are not inserted between strings.
  
  @return
  A concatenated string. If {@code strings} is {@code null},
  {@code null} is returned. If the size of {@code strings} is 0,
  an empty string is returned.