【发布时间】:2021-09-13 05:08:55
【问题描述】:
我必须根据公式中使用的输入格式返回文本。所以,
当我在 Framework 4.6 中检查 String.IndexofAny() 时,即使字符存在,它也会返回 -1。
示例:
公式:=TEXT(TODAY(),"MMMM");
textFormat = "MMMM";
char[] 格式 = { 'M', 'D', 'Y', 'S', 'T' };
| Condition | Framework 4.6 | .NET50 |
|---|---|---|
textFormat.IndexofAny(formats) |
-1 | 0 |
谁能帮我解释一下具体原因和解决方法?
【问题讨论】:
-
I cannot reproduce this.你能复制/粘贴一个兼容的复制品吗?
标签: c# frameworks console-application .net-5