string pattern = ".+\\";
foreach (string file in files){
richTextBox2.Text += Regex.Replace(file, @pattern, String.Empty) +"\n";
}
I am trying to do what should be a simple pattern match and replace, file consists of full path, for example: d:\test\t.txt. But everytime it crushes and says Illegal \ at the end of the pattern.
No joy where am I going wrong?