Question to LikeI used *withOUT* a wildcard

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
PeterH
Posts: 2785
Joined: 21 Nov 2005 20:39
Location: Germany

Question to LikeI used *withOUT* a wildcard

Post by PeterH »

This is just to verify: is "Abc" LikeI "abC" (no wildcard!)
exact identical to "Abc" == "abC" - but case-insensitive?
As it's much easier:

Code: Select all

  If ($a LikeI $b) {...}

instead of

  $a = recase($a, 'upper');
  $b = recase($b, 'upper');
  If ($a == $b) {...} 
If it is: maybe it would be fine to add a help-example:

echo "Abc" LikeI "abC"; //1 (no wildcard!)

(Or might there be a form of == to be case-insensitive? I don't think so...)
Win11 Pro 223H2 Gerrman

highend
Posts: 13315
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Question to LikeI used *withOUT* a wildcard

Post by highend »

Sure it is.

I guess you missed a tiny part in the description:
Where string is any string expression and Pattern may contain the usual wildcards and special chars used in XY patterns
Or might there be a form of == to be case-insensitive?
Some languages use this form of comparison (two instead of one =) to do case-sensitive / case-insensitive comparisons,
XY doesn't :mrgreen:
One of my scripts helped you out? Please donate via Paypal

admin
Site Admin
Posts: 60566
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Question to LikeI used *withOUT* a wildcard

Post by admin »

PeterH wrote:If it is: maybe it would be fine to add a help-example:

echo "Abc" LikeI "abC"; //1 (no wildcard!)
Done. :)

PeterH
Posts: 2785
Joined: 21 Nov 2005 20:39
Location: Germany

Re: Question to LikeI used *withOUT* a wildcard

Post by PeterH »

2 * thanks!

Yes - I've ignored the 'may contain'. :oops:

I think Don's help-extension makes it a bit more clear.

So: thanks again :tup:
Win11 Pro 223H2 Gerrman

Post Reply