Example usage for java.lang StringBuilder append

List of usage examples for java.lang StringBuilder append

Introduction

In this page you can find the example usage for java.lang StringBuilder append.

Prototype

@Override
    public StringBuilder append(double d) 

Source Link

Usage

From source file:Main.java

public static String buildMessageHtml(String message) {
    StringBuilder sb = new StringBuilder();
    sb.append("<article><section><div class=\"align-center\"><p class=\"text-x-small\">").append(message)
            .append("</p></div></section></article>");
    return sb.toString();
}

From source file:Main.java

public static String getHead(String name) {
    char c = name.charAt(name.length() - 1);
    StringBuilder sb = new StringBuilder();
    sb.append(c);
    return sb.toString();
}

From source file:Main.java

public static String generateConnectKey(String host, int port) {
    StringBuilder sb = new StringBuilder();
    sb.append(host);
    sb.append(":");
    sb.append(String.valueOf(port));
    return sb.toString();
}

From source file:Main.java

public static final String buildSelectApdu(String aid) {
    StringBuilder sb = new StringBuilder();
    sb.append("00A40400");
    sb.append(String.format("%02X", aid.length() / 2));
    sb.append(aid);// w w w .  ja v  a  2 s.com
    return sb.toString();
}

From source file:Main.java

private static void addImport(final StringBuilder sb, final String fqcn) {
    sb.append("import ");
    sb.append(fqcn);// w  w w .  j av  a 2 s .  com
    sb.append(";\n");
}

From source file:Main.java

public static <T> String ArrayAsString(final T[] array) {
    StringBuilder sb = new StringBuilder();
    sb.append("[").append(TextUtils.join(",", array)).append("]");
    return sb.toString();
}

From source file:Main.java

private static String int2ip(int ipInt) {
    StringBuilder sb = new StringBuilder();
    sb.append(ipInt & 0xFF).append(".");
    sb.append((ipInt >> 8) & 0xFF).append(".");
    sb.append((ipInt >> 16) & 0xFF).append(".");
    sb.append((ipInt >> 24) & 0xFF);
    return sb.toString();
}

From source file:Main.java

public static String int2ip(int ipInt) {
    StringBuilder sb = new StringBuilder();
    sb.append(ipInt & 0xFF).append(".");
    sb.append((ipInt >> 8) & 0xFF).append(".");
    sb.append((ipInt >> 16) & 0xFF).append(".");
    sb.append((ipInt >> 24) & 0xFF);
    return sb.toString();
}

From source file:Main.java

public static String int2ip(long ipInt) {
    StringBuilder sb = new StringBuilder();
    sb.append(ipInt & 0xFF).append(".");
    sb.append((ipInt >> 8) & 0xFF).append(".");
    sb.append((ipInt >> 16) & 0xFF).append(".");
    sb.append((ipInt >> 24) & 0xFF);
    return sb.toString();
}

From source file:Main.java

private static String getSpString(String mobile, String username, String password) {
    StringBuilder builder = new StringBuilder();
    builder.append(mobile).append(SPLIT_CHAR).append(username).append(SPLIT_CHAR).append(password);
    return builder.toString();
}