gpt4 book ai didi

c# - 为什么我的 C# 代码中出现 "The name Regex does not exist in the current context"?

转载 作者:行者123 更新时间:2023-12-02 02:06:31 25 4
gpt4 key购买 nike

为什么我会收到此错误:

The name Regex does not exist in the current context.

来 self 的代码?

if (Regex.IsMatch(string1, @"^[a-zA-Z]+$"))

最佳答案

确保引用了 System.Text.RegularExpressions 命名空间。

关于c# - 为什么我的 C# 代码中出现 "The name Regex does not exist in the current context"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19171357/

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