Created
May 21, 2020 23:56
-
-
Save goyuninfo/98da6fe604a15fd92d79d348bf362c18 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package info.goyun; | |
public class StringBuilderDemo { | |
public static void main(String[] args) { | |
StringBuilder str = new StringBuilder("Go.info"); | |
System.out.println("string = " + str); | |
// insert character value at offset 2 | |
str.insert(2, "Yun"); | |
// prints StringBuilder after insertion | |
System.out.print("After insertion = "); | |
System.out.println(str.toString()); | |
//output: After insertion = GoYun.inf | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment