Right. But that is why you can’t see the overbar in the console. ̅ is an HTML character encoding.
If you need to print M̅ to the console you need something along the lines of 'M' + String.fromCharCode(773)
Right. But that is why you can’t see the overbar in the console. ̅ is an HTML character encoding.
If you need to print M̅ to the console you need something along the lines of 'M' + String.fromCharCode(773)
Note that in this example, I’m working from an HTML encoded string. If HTML is never a component of your converter, then that step is superfluous. I left that in because you asked about converting a string with the HTML encoding to an array.
Ill just use that to get the arr ya of roman numerals, thanks
Assuming the platform has full Unicode support, you can use alternative Roman numerals such as ↁ = 5000.
Thanks, we used a simple loop to get the actual line over top.
const charCodes = 'M̅D̅C̅L̅X̅V̅';
const pattern = /.̅/g;
let charArray = charCodes.match(pattern);
for (let i in charArray) {
charArray[i] = charArray[i].replace(/̅/g, String.fromCharCode(773));
}
credit (ArielLeslie).
You can see the entire code at https://repl.it/@John_Nicole/Intermediate-Algorithm-Scripting-Roman-Numeral-Converter
(line 22 - 27 for the code just mentioned).