JAVA Insert () inserts a string
Insert () inserts a string
StringBuffer Insert (int index,string str)
StringBuffer insert (int index,char ch)
StringBuffer Insert (int index,object obj)
index specifies the subscript for inserting a string into the position of the StringBuffer object.
Reverse () Reverses the characters in the StringBuffer object
StringBuffer reverse ()
Delete () and Deletecharat () remove characters
StringBuffer Delete (int startindex,int endIndex)
StringBuffer deletecharat (int loc)
The requirement is this:
String str = "ABC";
String str1 = "abcdef";
Insert Str After the third character of the str1 string, and the final effect is: abcabcdef
Requires a very low-level method and does not allow the use of built-in functions
Try it with StringBuffer.
Using Srinbuilder
In the case of no concurrency. Efficiency is the highest.
Call the Insert method to insert a string at the specified location
StringBuilder sb=new StringBuilder ("IDSFKSJDFLKSAJDFKJH");
Sb.insert (5, "DSS");
Java Insert String