There is a line var text = " Привет мир9! Сегодня 17 августа.";

How to delete the first digit found in this line to make a string like:

" Привет мир! Сегодня 17 августа."

    1 answer 1

    Use replace More details here.

    Specifically according to your example:

      var text = " Привет мир9! Сегодня 17 августа."; console.log(text.replace(/\d/, ''));