Java String Explode explode(String[] elements, String separator)

Here you can find the source of explode(String[] elements, String separator)

Description

explode

License

Open Source License

Declaration

private static String explode(String[] elements, String separator) 

Method Source Code

//package com.java2s;
/**/*from w  ww  . j  av  a  2s .co  m*/
 *  Copyright (C) 2008 Progress Software, Inc. All rights reserved.
 *  http://fusesource.com
 *
 *  The software in this package is published under the terms of the AGPL license
 *  a copy of which has been included with this distribution in the license.txt file.
 */

public class Main {
    private static String explode(String[] elements, String separator) {
        StringBuffer result = new StringBuffer();
        for (int i = 0; i < elements.length; i++) {
            result.append(elements[i]);
            if (i + 1 < elements.length) {
                result.append(separator);
            }
        }
        return result.toString();
    }
}

Related

  1. explode(String source, String deliminator)
  2. explode(String split, String input)
  3. explode(String src, String sep)
  4. explode(String string, String separators)
  5. explode(String tokenizer, String text)
  6. explodeCamelCase(String str, boolean excludeGetOrSet)
  7. explodeDomains(final String fqdn)
  8. explodeLongs(String line, String sep)
  9. explodeQuoted(String arg)