开发者

Glob matching in C# - StringType.StrLike is apparently deprecated, whats the replacement?

I have recently开发者_如何学编程 upgraded from VS2005 to VS2010. In my .Net 2.0 code I referenced the Microsoft.VisualBasic.dll and used the StringType.StrLike method to perform glob string comparison. I just noticed that according to MSDN, StringType is deprecated. Is there a replacement for the Like operator in VS2010/.Net 4.0?


Try using the LikeOperator instead.

using Microsoft.VisualBasic.CompilerServices;

...

if (LikeOperator.LikeString(left, right, CompareMethod.Text)) {
  ...
}


Your link says StrLike is only for compiler infrastructure and you should just use the Like operator, which makes no mention of deprecation. Are you using Like or are you actually using StrLike?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜