Click here to watch in Youtube :
https://www.youtube.com/watch?v=VCdli5UxK1M&list=UUhwKlOVR041tngjerWxVccw
Click the below Image to Enlarge
Java Tutorial : Java StringBuffer [insert(int offset,String str) method] |
/* * public StringBuffer insert(int offset, String str) * * Inserts the string into this character sequence. * * Parameters: * ---------- * offset - the offset. * str - a string. * * Returns: * ------- * a reference to this object. */ public class StringBufferDemo { public static void main(String[] args) { StringBuffer sb = new StringBuffer("Hello World"); System.out.println(sb); String str = "My "; sb.insert(6, str); System.out.println(sb); } }
Hello World Hello My World
https://sites.google.com/site/javaee4321/java/StringBufferDemo_insert_str_app.zip?attredirects=0&d=1
Github Link:
https://github.com/ramram43210/Java/tree/master/BasicJava/StringBufferDemo_insert_str_app
Bitbucket Link:
https://bitbucket.org/ramram43210/java/src/3125abd5ca0481971a1d94fa90c039ac5e5df8f0/BasicJava/StringBufferDemo_insert_str_app/?at=master
See also:
No comments:
Post a Comment