> Is it possible to "Inline" VB code in a C# class? I need the Like
I don't think so. They would need to change the csc compiler to allow that.
statement, regular expressions are different enough that we would like two
searching options, "Like" and Regexs.
There is a LIKE in the Select statement if using a ADO table. Not sure
about just on strings. I don't think you need both, you should be able to
abstract your Regex methods to give you all the "like'ness" you need. That
way you don't need other DLLs - just c# code.
Here is a quick example. You can make as fancy as you need. I don't know
all the VB syntax for Like, but you can get what you need using regex. HTH
//VB
//if ( stringA Like "%bill%tom% )
//- c# could be --
string stringA = "is bill and tom in this string?";
string pattern = "bill.*tom" ;
Regex rgx = new Regex(pattern);
if (rgx.IsMatch(st ringA))
Console.WriteLi ne("Yes. Found match.");
else
Console.WriteLi ne("Did not find match.");
--
William Stacey, MVP