Strange vb Like operator

  • Thread starter Thread starter Jan Sika
  • Start date Start date
J

Jan Sika

Try this:

Console.WriteLine(("ab" Like "*a*b*").ToString)
Console.WriteLine(("aa" Like "*a*a*").ToString)

Result:
True
False

???????????

Jan
 
* "Jan Sika said:
Try this:

Console.WriteLine(("ab" Like "*a*b*").ToString)
Console.WriteLine(("aa" Like "*a*a*").ToString)

Result:
True
False

???????????

Don't use 'Like'. 'Like' is buggy!!!
 
Jan,
In addition to Herfried's comments.

Have you considered using System.Text.RegularExpressions.RegEx instead?

I'm not sure RegEx would fair any better, without tweaking your expession to
match against...

Hope this helps
Jay
 
Back
Top