Click here to watch in Youtube :
https://www.youtube.com/watch?v=i6-sKDJlLDc&list=UUhwKlOVR041tngjerWxVccw
Click the below Image to Enlarge
Java Tutorial : Java StringBuilder [insert(int offset,String str) method] |
/* * public StringBuilder insert(int offset, String str) * * Parameters: * ---------- * offset - the offset. * * str - a string. * * Returns: * ------- * a reference to this object. */ public class StringBuilderDemo { public static void main(String[] args) { StringBuilder sb = new StringBuilder("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/StringBuilderDemo_insert_App.zip?attredirects=0&d=1
Github Link:
https://github.com/ramram43210/Java/tree/master/BasicJava/StringBuilderDemo_insert_App
Bitbucket Link:
https://bitbucket.org/ramram43210/java/src/ea6705eb8d861d880326570ef3992b3db7646c7d/BasicJava/StringBuilderDemo_insert_App/?at=master
See also:
No comments:
Post a Comment