Example usage for java.lang StringBuffer insert

List of usage examples for java.lang StringBuffer insert

Introduction

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

Prototype

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

Source Link

Usage

From source file:MainClass.java

public static void main(String args[]) {
    StringBuffer sb = new StringBuffer("hello world!");
    sb.insert(6, "there ");
    System.out.println(sb);// w  ww .  j a v  a 2  s.co m
}

From source file:MainClass.java

public static void main(String[] arg) {
    StringBuffer phrase = new StringBuffer("one two three four");
    phrase.insert(4, "old");

    System.out.println(phrase);/*from w w  w .  ja v a2 s  .c  o  m*/

}

From source file:Main.java

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

    int integerValue = 7;
    buffer.insert(0, integerValue);

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

}

From source file:Main.java

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

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

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

}

From source file:Main.java

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

    double doubleValue = 33.3;
    buffer.insert(0, doubleValue);

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

}

From source file:Main.java

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

    char characterValue = 'K';
    buffer.insert(0, characterValue);

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

}

From source file:Main.java

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

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

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

}

From source file:Main.java

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

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

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

}

From source file:Main.java

public static void main(String[] argv) throws Exception {
    StringBuffer buf = new StringBuffer("Java this is a test");

    int index = 5;
    buf.insert(index, "Developers ");
    System.out.println(buf);//from   w  ww  . j  a  v  a 2s  .  co  m
}

From source file:Main.java

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

    String string = "java2s.com";
    buffer.insert(0, string);

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

}