Use case:
I have a function that receives a string and I want to parse the <Code> .... </Code>
and get the contents in between the code block.
const input = `<Code> Error in Something </Code>`
const getErrorMessage = parseCode(input); // Error in something
I'm confused on how to proceed. I initially thought of proceeding with RegEx but wasn't sure if there is a better solution.
...
` then it's pretty trivial. – Dave Newton Feb 01 '21 at 19:05Error in Header
` @DaveNewton – TechnoCorner Feb 01 '21 at 19:08Error in Something
"; let item1 = (input.split("")[1]).split("
")[0]; item1 = stuff between two tags. – raddevus Feb 01 '21 at 19:08Error in Something
".replace(/<\/?Code>/, '').trim(); console.log(output);` – Randy Casburn Feb 01 '21 at 19:09