gpt4 book ai didi

c# - 为什么 Regex.Match 没有 GetEnumerator 函数?

转载 作者:太空宇宙 更新时间:2023-11-03 17:16:26 25 4
gpt4 key购买 nike

Regex.Match 有 .Success 和 .NextMatch 为什么它没有 GetEnumerator 函数?

按照我的逻辑,实现起来似乎很容易。但它不在 3.5 中,所以谁能告诉我为什么不呢?

foreach (var m in Regex.Match("dummy text", "mm")) error CS1579: foreach statement cannot operate on variables of type 'System.Text.RegularExpressions.Match' because 'System.Text.RegularExpressions.Match' does not contain a public definition for 'GetEnumerator'

最佳答案

也许你想要Regex.Matches

关于c# - 为什么 Regex.Match 没有 GetEnumerator 函数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1758685/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com