Check out example codes for "replace a char in string c++ at a specific index". It will help you in understanding the concepts better.

Code Example 1

string a = "lol";
	a[2] = 'j';
	cout << a;
//output: loj

Learn ReactJs, React Native from akashmittal.com