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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top