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 =; // 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