JSFiddle - React, Tailwind, and code Playground

by kendfrey

JavaScript

function RemoveBackspaces(str)
{
    while (str.indexOf("\b") != -1)
    {
        str = str.replace(/.\x08/, "");
    }
    return str;
}
alert(RemoveBackspaces("Hello\b\b\b\bi, World!"));