0

I need to detect if multiple slashes exist besides.

/string///string//string/string

enter image description here

1 Answers1

-1
var str = "/string///string//string/string";
var pattern = new RegExp("/");
var result = pattern .test(str);

console.log(result );
  • 1
    While this code may answer the question, providing additional context regarding how and/or why it solves the problem would improve the answer's long-term value. You can find more information on how to write good answers in the help center: https://stackoverflow.com/help/how-to-answer . Good luck – nima Sep 30 '21 at 06:51
  • How does this find repeated slashes, as OP asked? – joanis Sep 30 '21 at 12:42