public bool IsGUID(string str)
{
Match m = Regex.Match(str, @"^[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}$", RegexOptions.IgnoreCase);
if (m.Success)
{
//可以转换
//Guid guid = new Guid(str);
return true;
}
else
{
//不可转换
return false;
}
}
相关文章:
-
2021-12-15
-
2021-07-02
-
2022-02-04
-
2021-09-26
-
2021-10-02
-
2021-11-17
-
2021-12-04
-
2021-11-28
猜你喜欢
-
2022-12-23
-
2022-12-23
-
2022-01-15
-
2022-12-23
-
2021-09-03
-
2021-07-05
-
2022-01-24
相关资源
-
下载
2022-12-30
-
下载
2023-04-09
-
下载
2021-06-05