Skip to main content
deleted 9 characters in body
Source Link
AndrewL64
  • 16.4k
  • 8
  • 51
  • 87

I have this string:

var someString = "23/03/2012";

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

I tried to do this:

someString.replace(///g, "-");

But it seems you cant have a forward slash / in there.

Thanks

I have this string:

var someString = "23/03/2012";

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

I tried to do this:

someString.replace(///g, "-");

But it seems you cant have a forward slash in there.

Thanks

I have this string:

var someString = "23/03/2012";

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

I tried to do this:

someString.replace(///g, "-");

But it seems you cant have a forward slash / in there.

Source Link
Mo.
  • 43.1k
  • 38
  • 90
  • 134

Replace forward slash "/ " character in JavaScript string?

I have this string:

var someString = "23/03/2012";

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

I tried to do this:

someString.replace(///g, "-");

But it seems you cant have a forward slash in there.

Thanks