List of usage examples for java.lang StringBuilder toString
@Override
@HotSpotIntrinsicCandidate
public String toString()
From source file:com.alibaba.jstorm.utils.SystemOperation.java
public static void umount(String name) throws IOException { StringBuilder sb = new StringBuilder(); sb.append("umount ").append(name); SystemOperation.exec(sb.toString()); }
From source file:Main.java
public static String revStr(String s) { StringBuilder sb = new StringBuilder(); for (int i = s.length() - 1; i >= 0; i--) { sb.append(s.charAt(i));/*from w w w .ja va 2s .c o m*/ } return sb.toString(); }
From source file:Main.java
public static String randomDecimalString(int ndigits) { StringBuilder result = new StringBuilder(); for (int i = 0; i < ndigits; i++) { result.append(randomDecimalDigit()); }/*from w ww. ja v a 2 s . c o m*/ return result.toString(); }
From source file:Main.java
public static String getUnTypedTemplateName(String methodName) { StringBuilder sb = new StringBuilder(); sb.append("method_"); sb.append(methodName);/*from w w w .j a v a 2 s . co m*/ return sb.toString(); }
From source file:Main.java
public static String repeat(String str, int times) { StringBuilder ret = new StringBuilder(); for (int i = 0; i < times; i++) ret.append(str);/*from w w w . java 2 s. c om*/ return ret.toString(); }
From source file:Main.java
public static String builder(String... array) { StringBuilder s = new StringBuilder(); for (String str : array) { s.append(str);//from w w w .j a v a2 s . c o m } return s.toString(); }
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 swapChars(String str, int lIdx, int rIdx) { StringBuilder sb = new StringBuilder(str); char l = sb.charAt(lIdx), r = sb.charAt(rIdx); sb.setCharAt(lIdx, r);//from ww w .j a v a 2 s. c om sb.setCharAt(rIdx, l); return sb.toString(); }
From source file:Main.java
public static String toString(Node n) { StringBuilder buf = new StringBuilder(); append(n, buf, 0);/* www .j a v a 2 s. c om*/ return buf.toString(); }
From source file:Main.java
public static String[] populateStringArray(int numberOfItems) { final String partialWord = "partialArrayParallel"; String[] dummyStringArray = null; if (numberOfItems > 0) { dummyStringArray = new String[numberOfItems]; for (int i = 0; i < numberOfItems; i++) { final double randomNumber = (Math.random() * numberOfItems); final StringBuilder sb = new StringBuilder(partialWord).append(randomNumber); dummyStringArray[i] = sb.toString(); }/*w w w .ja v a 2 s. c om*/ } return dummyStringArray; }