search

Home  >  Q&A  >  body text

javascript - Regular expression to change \ in string to /

Change:
FilesemapServer_192.168.8.109 East Chang'an Street Sixth Floor.jpg
to:
/Files/emap/Server_192.168.8.109/East Chang'an Street Sixth Floor.jpg

大家讲道理大家讲道理2753 days ago492

reply all(1)I'll reply

  • 阿神

    阿神2017-05-19 10:25:20

    I don’t see what language it is, I only see the tag is javascript, just use javascript syntax

    a = '\Filesemap\Server_192.168.8.109\东长安街六层.jpg'
    a.replace(/\/g, '/')

    reply
    0
  • Cancelreply