Search code examples
javascriptreplacetrim

How to remove white space for string " $ … 123.56 " in javascript


i have getting my input as $ … 123.56. How to change it has "$ 123.56" in javascript


Solution

  • I guess you're looking for this?

    var priceInput = " $ … 123.56 ";
    var priceOutput = priceInput.replace('… ', '');