1

I want to replace all occurences of multiple slash ('') with single backslash

For example

mama\\\\Please\\\\\U0U0001f973\U00.txt

Result  should be this
mama\Please\U0U0001f973\U00.txt

I have tried

string file = "mama\\\\Please\\\\\U0U0001f973\U00.txt"
string output = Regex.Replace(file, @"[/\\]{2,}", @"\");

current result

mama\\Please\\\U0U0001f973\U00.txt
phuzi
  • 12,078
  • 3
  • 26
  • 50
BUlle7
  • 153
  • 3
  • 15

0 Answers0