Home > Software engineering >  Remove underlines from string
Remove underlines from string

Time:01-15

I accidentally used an online tool on this text

h̲t̲t̲p̲:̲/̲/̲f̲i̲d̲d̲l̲e̲.̲j̲s̲h̲e̲l̲l̲.̲n̲e̲t̲/̲G̲S̲S̲C̲D̲/̲2̲0̲3̲/̲/̲s̲h̲o̲w̲/̲"̲ ̲-̲H̲ ̲"̲R̲e̲f̲e̲r̲e̲r̲:̲ ̲h̲t̲t̲p̲:̲/̲/̲f̲i̲d̲d̲l̲e̲.̲j̲s̲h̲e̲l̲l̲.̲n̲e̲t̲/̲G̲S̲S̲C̲D̲/̲2̲0̲3̲/̲/̲"̲ ̲-̲-̲o̲u̲t̲p̲u̲t̲ ̲"̲f̲i̲d̲d̲l̲e̲.̲h̲t̲m̲l̲

and now the underscoring seems to be baked together with the letters.

Is there a way to remove this easily ? Te underscore sticks to the text rather well...

Copy the text through numerous online converters nd put ut ino textfields usualky dismissive of markdown

CodePudding user response:

The text is interspersed with the Combining Low Line character 818; the original ASCII characters are still there, so all you need to do is replace each occurrence of those 818 characters.

console.log(
  'h̲t̲t̲p̲:̲/̲/̲f̲i̲d̲d̲l̲e̲.̲j̲s̲h̲e̲l̲l̲.̲n̲e̲t̲/̲G̲S̲S̲C̲D̲/̲2̲0̲3̲/̲/̲s̲h̲o̲w̲/̲"̲ ̲-̲H̲ ̲"̲R̲e̲f̲e̲r̲e̲r̲:̲ ̲h̲t̲t̲p̲:̲/̲/̲f̲i̲d̲d̲l̲e̲.̲j̲s̲h̲e̲l̲l̲.̲n̲e̲t̲/̲G̲S̲S̲C̲D̲/̲2̲0̲3̲/̲/̲"̲ ̲-̲-̲o̲u̲t̲p̲u̲t̲ ̲"̲f̲i̲d̲d̲l̲e̲.̲h̲t̲m̲l̲'
  .replaceAll(String.fromCharCode('818'), '')
);

  • Related