Java Array to String array2String(String[] p, String spliter)

Here you can find the source of array2String(String[] p, String spliter)

Description

array String

License

Open Source License

Declaration

public static String array2String(String[] p, String spliter) 

Method Source Code

//package com.java2s;
/*/*from w  w w  .  ja v a  2s  .com*/
 * Copyright 2005-2020 GreenTube Team All rights reserved.
 * Support: Huxg
 * License: CND team license
 */

public class Main {
    public static String array2String(String[] p, String spliter) {
        if (p == null)
            return null;

        StringBuffer sb = new StringBuffer();
        for (int i = 0; i < p.length; i++) {
            if (i == 0)
                sb.append(p[i]);
            else
                sb.append(spliter).append(p[i]);
        }
        return sb.toString();
    }
}

Related

  1. array2string(Object[] array)
  2. array2String(Object[] objs)
  3. array2String(String[] array)
  4. array2String(String[] array)
  5. array2String(String[] category)
  6. Array2String(String[] values)
  7. array2String(T... array)
  8. array2String(T[] array, String splitFlag, boolean useBracket)
  9. arrayContent(int[] ar)