JS Regex to remove numbers after last hyphen in a string

前端 未结 0 1682
我寻月下人不归
我寻月下人不归 2021-01-17 11:01

Trying to remove numbers after the last hyphen. I tried the below but not working.

const str = \'HYC-HTY-VB23\';
const result = str.toLowerCase().replace(/-\\         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题