Regex in JavaScript

Posted by dfjhdfjhdf on Stack Overflow See other posts from Stack Overflow or by dfjhdfjhdf
Published on 2010-06-01T13:58:23Z Indexed on 2010/06/01 14:03 UTC
Read the original article Hit count: 237

Filed under:
|

Suppose we don't know how many slashes we could get in a string but we do not want any extra slashes. So if we get this string '/hello/world///////how/are/you//////////////' we should transform it to the form of '/hello/world/how/are/you/'. How to do it with the help of regular expressions in JavaScript?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about regex