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?
精彩评论