string.Replace()方法正在替换不应替换的字符。我正在尝试替换这样的日期:1/1/2019,2/2/2019,3/3/2019
日期是这样的:01/01/2019,02/02/2019,03/03/2019
问题是我的代码只为我提供:
1/01/2019(如果我使用“ / 1 /”)或02/02/02019,这取决于我使用的代码。
//public readonly string[] dateStringErrors = { "/1/", "/2/", "/3/", "/4/", "/5/", "/6/", "/7/", "/8/", "/9/" }; // uncomment if below code fails
public readonly string[] dateStringErrors = { "1/", "2/", "3/", "4/", "5/", "6/", "7/", "8/", "9/" };
//public readonly string[] fixedDateStrings = { "/01/", "/02/", "/03/", "/04/", "/05/", "/06/", "/07/", "/08/", "/09/" }; // uncomment if below code fails
public readonly string[] fixedDateStrings = { "01/", "02/", "03/", "04/", "05/", "06/", "07/", …Run Code Online (Sandbox Code Playgroud)