skip to Main Content

Replacing letters in a string using javaScript

function dnaStrand(dna){ const compl = dna; dna.includes("A") && compl.replace(/A/g, "T"); dna.includes("T") && compl.replace(/T/g, "A") dna.includes("C") && compl.replace(/C/g, "G") dna.includes("G") && compl.replace(/G/g, "C") console.log(compl) return compl } I intend to form the complementary dna strand, that is, A is complementary to…

VIEW QUESTION

What python script will find the locations of every backslash inside of an HTML tag and replace the backslash with a forward slash?

Test Input <!DOCTYPE html> <html> <head> <title>This is a title</title> <head> <body> <div> <p>H/e/l/l/o abcdefgw/o/r/l/d!</p> </div> <body> <html> Test Output <!DOCTYPE html> <html> <head> <title>This is a title</title> </head> <body> <div> <p>H/e/l/l/o abcdefgw/o/r/l/d!</p> </div> </body> </html> We do not want…

VIEW QUESTION
Back To Top
Search