Java URI to uriToString(URI[] uris)

Here you can find the source of uriToString(URI[] uris)

Description

uri To String

License

Open Source License

Parameter

Parameter Description
uris a parameter

Declaration

public static String uriToString(URI[] uris) 

Method Source Code

//package com.java2s;

import java.net.URI;

public class Main {
    /**//w w  w.  ja  va  2 s  .c om
     * 
     * @param uris
     */
    public static String uriToString(URI[] uris) {
        if (uris == null) {
            return null;
        }
        StringBuffer ret = new StringBuffer(uris[0].toString());
        for (int i = 1; i < uris.length; i++) {
            ret.append(",");
            ret.append(uris[i].toString());
        }
        return ret.toString();
    }

    public static String toString(String[] content, String sign) {
        if (null == content) {
            return null;
        }

        sign = null == sign ? "," : sign;
        StringBuilder strBuilder = new StringBuilder();
        for (int i = 0; i < content.length; i++) {
            strBuilder.append(content[i]);
            if (i < content.length - 1) {
                strBuilder.append(sign);
            }
        }

        return strBuilder.toString();
    }
}

Related

  1. toStringList(List list)
  2. toStringSet(Collection uris)
  3. toUnencodedString(URI uri)
  4. URItoString(URI uri)
  5. uriToString(URI[] uris)