Click here to watch in Youtube :
https://www.youtube.com/watch?v=dTzU533XAa0&list=UUhwKlOVR041tngjerWxVccw
Click the below Image to Enlarge
Java Tutorial : Java StringBuffer [replace(int start, int end,String str) method] |
/* * public StringBuffer replace(int start, int end, * String str) * * Parameters: * ----------- * start - The beginning index, inclusive. * * end - The ending index, exclusive. * * str - String that will replace previous contents. * * Returns: * -------- * This object. */ public class StringBufferDemo { public static void main(String[] args) { StringBuffer sb = new StringBuffer("Hello Dave Welcome"); System.out.println(sb); sb = sb.replace(6, 10, "Peter"); System.out.println(sb); } }
Hello Dave Welcome Hello Peter Welcome
https://sites.google.com/site/javaee4321/java/StringBufferDemo_Replace_App.zip?attredirects=0&d=1
Github Link:
https://github.com/ramram43210/Java/tree/master/BasicJava/StringBufferDemo_Replace_App
Bitbucket Link:
https://bitbucket.org/ramram43210/java/src/3125abd5ca0481971a1d94fa90c039ac5e5df8f0/BasicJava/StringBufferDemo_Replace_App/?at=master
See also:
No comments:
Post a Comment