tags:

views:

110

answers:

2

Hello, I want to know if exists namespace available for C#, cause this class come from :

Microsoft.VisualBasic.CompilerServices

cause I want to do something like this, but in C#:

Dim m = GetType(CompilerServices.Operators).GetMethod("LikeString")

Thanks

A: 

LikeString is a method that is used by the Like operator in VB. There's no equivalent operator in c# but you could use IsMatch to achieve similar functionality:

bool bResult = Regex.IsMatch("some input string", "[a-z]*");
Darin Dimitrov
His question was very confusing, I wasn't sure if your take on the question or mine was going to be what he was looking for...
Frank Krueger
+1  A: 

Sure it can do that without trouble. You will have to reference the VisualBasic assembly in your C# project.

var m = CompilerServices.Operators.GetType().GetMethod("LikeString");
Frank Krueger