c# - How to use Regex.Replace to Replace Two Strings at Once? -
I have the following method which is replacing the "pound" sign with the file name, but I was also able to change it Want to be "Single Apostrophy" at the same time? How can I do this? The value of this file name is = Provider license_A'R_Ab # acus Settlements_1-11-09.xls
Remove static string BadCharPound (string filename) {// "_" Illegal characters with char Change to // I want something like that, but this is not working // Return Reggae Replay (filename, "# '", "_"); Return Regex.Replace (filename, "#", "_"); }
Try
return Regex.Replace ( file name, "[#']", "_"); Remember me, I'm not sure that a regex is likely to be much faster than simple: file name back. Place ('#', '_'). To change ('\', '_');
Comments
Post a Comment