[Mono-list] How to fix StrLike bug in 2.4

Jonathan Pobst monkey at jpobst.com
Mon Mar 22 17:03:22 EDT 2010


You can try using the Regex.Escape mentioned in your link, like this:

public static bool Like(string pattern, string source)
{
   pattern = Regex.Escape (pattern);

   return
   Microsoft.VisualBasic.CompilerServices.StringType.StrLike(source, 
pattern, Microsoft.VisualBasic.CompareMethod.Text);
}

Jonathan

On 3/22/2010 3:47 PM, Andrus wrote:
>> There are three options:
>
> This was discussed in
> http://groups.google.com/group/microsoft.public.dotnet.languages.csharp/browse_thread/thread/32649965654df408/57ba3e39a6c2711f?lnk=st&q=#57ba3e39a6c2711f
>
>
> Pattern is not known at design time. I need to implement function below.
> How to make this function work properly in Mono 2.4 ?
>
> Andrus.
>
> public static bool Like(string pattern, string source)
> {
> return
> Microsoft.VisualBasic.CompilerServices.StringType.StrLike(source, pattern,
> Microsoft.VisualBasic.CompareMethod.Text);
> }
>
>
>



More information about the Mono-list mailing list