我有以下方法从文件名替换"磅"符号,但我也希望能够同时替换"单撇号".我该怎么做?这是filename = Provider license_A'R_Ab#acus Settlements_1-11-09.xls的值
static string removeBadCharPound(string filename)
{ // Replace invalid characters with "_" char.
//I want something like this but is NOT working
//return Regex.Replace(filename, "# ' ", "_");
return Regex.Replace(filename, "#", "_");
}
Run Code Online (Sandbox Code Playgroud)