List of usage examples for java.lang StringBuilder StringBuilder
@HotSpotIntrinsicCandidate
public StringBuilder()
From source file:Main.java
public static void main(String args[]) { StringBuilder buffer = new StringBuilder(); char charArray[] = { 'a', 'b', 'c', 'd', 'e', 'f' }; buffer.insert(0, charArray);/*from ww w. j a v a2 s .com*/ System.out.println(buffer.toString()); }
From source file:Main.java
public static void main(String args[]) { StringBuilder buffer = new StringBuilder(); double doubleValue = 33.3; buffer.insert(0, doubleValue);/*from ww w.j a v a2 s .c o m*/ System.out.println(buffer.toString()); }
From source file:Main.java
public static void main(String args[]) { StringBuilder buffer = new StringBuilder(); char charArray[] = { 'a', 'b', 'c', 'd', 'e', 'f' }; buffer.insert(0, charArray, 3, 3);//from w ww. j av a 2 s .c o m System.out.println(buffer.toString()); }
From source file:Main.java
public static void main(String args[]) { StringBuilder buffer = new StringBuilder(); char characterValue = 'K'; buffer.insert(0, characterValue);//from w w w . j a va2s . c o m System.out.println(buffer.toString()); }
From source file:Main.java
public static void main(String args[]) { StringBuilder buffer = new StringBuilder(); String string = "java2s.com"; buffer.insert(0, string);//from w w w. j a v a 2s . c o m System.out.println(buffer.toString()); }
From source file:Main.java
public static void main(String args[]) { StringBuilder buffer = new StringBuilder(); float floatValue = 2.5f; buffer.insert(0, floatValue);// w w w. j a v a 2s . c om System.out.println(buffer.toString()); }
From source file:Main.java
public static void main(String[] arg) { StringBuilder buffer = new StringBuilder(); int i = 123;/*from www. ja va 2s. co m*/ buffer.append(i); System.out.println(buffer); }
From source file:Main.java
public static void main(String[] arg) { StringBuilder buffer = new StringBuilder(); Object o = "from java2s.com"; buffer.append(o);/*from ww w . j av a 2s .co m*/ System.out.println(buffer); }
From source file:Main.java
public static void main(String[] arg) { StringBuilder buffer = new StringBuilder(); long l = 123456789098765L; buffer.append(l);//from ww w . j av a 2 s.c o m System.out.println(buffer); }
From source file:Main.java
public static void main(String[] argv) { StringBuilder sb = new StringBuilder(); sb.append("java2s.com"); System.out.println(sb.length()); System.out.println(sb.capacity()); sb.trimToSize();/*from w w w. j a v a2 s. c o m*/ System.out.println(sb.length()); System.out.println(sb.capacity()); }