Glob alignment in C # - StringType.StrLike, apparently not recommended, what replacement?

I recently upgraded from VS2005 to VS2010. In my .Net 2.0 code, I referenced Microsoft.VisualBasic.dll and used the StringType.StrLike method to perform glob string comparisons. I just noticed that according to MSDN StringType is deprecated. Is there a replacement for the Like operator in VS2010 / .Net 4.0?

+4
source share
2 answers

Try using LikeOperator .

 using Microsoft.VisualBasic.CompilerServices; ... if (LikeOperator.LikeString(left, right, CompareMethod.Text)) { ... } 
+6
source

Your link says that StrLike is for the compiler infrastructure only, and you should just use the Like statement, which doesn't mention obsolescence. Do you use Like or use StrLike?

+1
source

Source: https://habr.com/ru/post/1347270/


All Articles