Check out example codes for "java string replace character at position". It will help you in understanding the concepts better.

Code Example 1

String str = in.nextLine();	//Original String
char cr = in.next().charAt(0); // character to replace
int index = in.nextInt();	// Index where replaced
str = str.substring(0, index) + cr + str.substring(index + 1);// modified string

Learn ReactJs, React Native from akashmittal.com