Example usage for java.lang String concat

List of usage examples for java.lang String concat

Introduction

In this page you can find the example usage for java.lang String concat.

Prototype

public String concat(String str) 

Source Link

Document

Concatenates the specified string to the end of this string.

Usage

From source file:com.jslsolucoes.tagria.lib.tag.x.StringUtil.java

public static String concat(String left, String right) {
    return left.concat(right);
}

From source file:Main.java

/**
 * Utility function to convert given List to a string appended with semi colon
 * @param toList/*  w  ww.  j a  v  a 2 s  .  c om*/
 * @return
 */
public static String ListToString(List<String> toList) {
    String toString = "";
    for (String email : toList) {
        toString.concat(email + ";");
    }
    return toString;
}

From source file:net.mamian.mySpringboot.utils.SecurityUtils.java

/**
 * ?//from   ww w. j  a va 2  s. co  m
 */
private static byte[] blend(String a, String b) {
    return a.concat(b).getBytes();
}

From source file:Main.java

public static String assertSlash(final String ofString) {
    if (ofString.endsWith("/"))
        return ofString;

    return ofString.concat("/");
}

From source file:Main.java

/**
 * Verification: is algorithm supported or not
 *
 * @param algorithm//from  ww w.  j  av a2s .c om
 * @param service
 * @return
 */
public static Provider isSupport(String algorithm, String service) {
    try {
        Provider[] provs = Security.getProviders(service.concat(".").concat(algorithm));
        if (provs == null) {
            return null;
        }
        return (provs.length == 0 ? null : provs[0]);
    } catch (Exception e) {
        return null;
    }
}

From source file:Main.java

public static String getImageType(String url, String type) {
    if (TextUtils.isEmpty(url)) {
        return null;
    }//from w w  w  .  j av  a  2  s.c o m

    return url.concat(type);
}

From source file:Main.java

public static String getTimeFormat(String timestr) {

    String datetimestr = new String();

    datetimestr = timestr.substring(5, 7);

    datetimestr = datetimestr.concat("/");

    datetimestr = datetimestr.concat(timestr.substring(8, 10));

    datetimestr = datetimestr.concat(" ");

    datetimestr = datetimestr.concat(timestr.substring(11, 16));

    return datetimestr;

}

From source file:io.bitsquare.app.BitsquareExecutable.java

protected static String description(String descText, Object defaultValue) {
    String description = "";
    if (StringUtils.hasText(descText))
        description = description.concat(descText);
    if (defaultValue != null)
        description = join(" ", description, format("(default: %s)", defaultValue));
    return description;
}

From source file:Main.java

public static String md5Calc(File f) {
    int i;/* w  w w. j  av a2 s .  co m*/

    byte[] buffer = new byte[1024];
    int read = 0;
    String md5hash;
    try {
        MessageDigest digest = MessageDigest.getInstance("MD5");
        InputStream is = new FileInputStream(f);
        while ((read = is.read(buffer)) > 0) {
            digest.update(buffer, 0, read);
        }
        byte[] md5sum = digest.digest();
        BigInteger bigInt = new BigInteger(1, md5sum);
        md5hash = bigInt.toString(16);
        is.close();
    } catch (Exception e) {
        e.printStackTrace();
        return null;
    }

    if (md5hash.length() != 33) {
        String tmp = "";
        for (i = 1; i < (33 - md5hash.length()); i++) {
            tmp = tmp.concat("0");
        }
        md5hash = tmp.concat(md5hash);
    }

    return md5hash;
}

From source file:com.github.caldav4j.util.UrlUtils.java

public static String ensureTrailingSlash(String s) {
    return (s.endsWith("/")) ? s : s.concat("/");
}