string.replace('characterToReplace', '');
stra = 'Meatloaf'
posn = 5
nc = 'x'
stra = string[:posn] + nc + string[posn+1:]
print(stra)
function replaceAt(index, word, replacement)
{
let partOne = word.substring(0, index)
let partTwo = word.substring(index, word.length-1);
let answer = partOne + replacement + partTwo;
return answer;
}
var s = new String("AAAAA");
for(var i =0; i<s.length; i++)
{
if(s[i]=="A")
{
s= replaceAt(i, s, "@@@@");
}
}
console.log(s);
/*console.log() @@@@@@@@@@@@@@@@@@@@*/
stra = 'Meatloaf'
posn = 5
nc = 'x'
stra = string[:posn] + nc + string[posn+1:]
print(stra)
stra = 'Meatloaf'
posn = 5
nc = 'x'
stra = string[:posn] + nc + string[posn+1:]
print(stra)