Replace forward slash “/ ” character in JavaScript string?

前端 未结 8 576
你的背包
你的背包 2020-12-02 15:35

I have this string:

var someString = \"23/03/2012\";

and want to replace all the \"/\" with \"-\".

I tried to do this:

<         


        
8条回答
  •  臣服心动
    2020-12-02 15:47

    Area.replace(new RegExp(/\//g), '-') replaces multiple forward slashes (/) with -

提交回复
热议问题