Check out example codes for "insert string in string java". It will help you in understanding the concepts better.

Code Example 1

String newString = originalString.substring(0, index + 1) 
                           + stringToBeInserted 
                           + originalString.substring(index + 1);

Learn ReactJs, React Native from akashmittal.com