Example usage for java.lang StringBuilder insert

List of usage examples for java.lang StringBuilder insert

Introduction

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

Prototype

@Override
public StringBuilder insert(int offset, double d) 

Source Link

Usage

From source file:Main.java

public static void main(String args[]) {
    StringBuilder buffer = new StringBuilder();

    float floatValue = 2.5f;
    buffer.insert(0, floatValue);

    System.out.println(buffer.toString());

}

From source file:Main.java

public static void main(String args[]) {
    StringBuilder buffer = new StringBuilder();

    long longValue = 10000000;
    buffer.insert(0, longValue);

    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);

    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);

    System.out.println(buffer.toString());

}

From source file:Main.java

public static void main(String args[]) {
    StringBuilder buffer = new StringBuilder();

    boolean booleanValue = true;
    buffer.insert(0, booleanValue);

    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);

    System.out.println(buffer.toString());

}

From source file:Main.java

public static void main(String args[]) {
    StringBuilder buffer = new StringBuilder();

    Object objectRef = "java2s.com";
    buffer.insert(0, objectRef);
    System.out.println(buffer.toString());

}

From source file:Main.java

public static void main(String[] arg) {

    StringBuilder buffer = new StringBuilder("from java2s.com");
    CharSequence cs = "java2s.com";
    buffer.insert(2, cs);
    System.out.println(buffer);//from   w w w . j a v  a  2 s  .c  o  m
}

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);

    System.out.println(buffer.toString());

}

From source file:Main.java

public static void main(String[] a) {
    StringBuilder builder = new StringBuilder("Line 1\n");

    builder.append("Line 3\n");

    builder.insert(0, "Line 2\n");

    System.out.println(builder.toString());

    builder = builder.delete(2, 6);//from  w  ww .  j ava2s .  com

    System.out.println(builder.toString());

}