1function addStr(str, index, stringToAdd){
2 return str.substring(0, index) + stringToAdd + str.substring(index, str.length);
3}
4
5let str = "This is a string";
6let stringToAdd = "modyfied ";
7
8console.log(addStr(str, 10, stringToAdd)); //outPut : "This is a modified string"
9
1int j = 123456;
2String x = Integer.toString(j);
3x = x.substring(0, 4) + "." + x.substring(4, x.length);
4
5//output : 1234.56