Java String Array to String argsToString(String[] args)

Here you can find the source of argsToString(String[] args)

Description

args To String

License

Apache License

Declaration

public static String argsToString(String[] args) 

Method Source Code

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

public class Main {
    public static String argsToString(String[] args) {
        if (args == null || args.length == 0) {
            return "";
        }//from   w  ww . j  a v  a2 s  .com
        boolean firstTime = true;
        StringBuilder sb = new StringBuilder();
        for (String s : args) {
            if (!firstTime) {
                sb.append(":");
            }
            sb.append(s);
            firstTime = false;
        }
        return sb.toString();
    }
}

Related

  1. argsToString(String args[], int minindex, int maxindex)
  2. argsToString(String separator, T... args)
  3. argsToString(String[] args, int start)
  4. argsToString(String[] args, int startFrom)
  5. arr2str(String[] arr)
  6. arr2str(String[] arr, String sep)