Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ignore case in IF comparision

Is there an easy way to do this comparision with ignorecase ON?

If file.Extension = ".Lnk" Then MsgBox(file.Extension)

What i'm trying to do is to get all the ".lnk" or ".LNK" or ".lNk" or " ".Lnk" etc...

I know this is possibly with RegEx but... there's an easy way for that example?

Thankyou for read

like image 271
ElektroStudios Avatar asked Oct 16 '25 09:10

ElektroStudios


1 Answers

Convert the extension to lowercase using ToLower and then compare

If file.Extension.ToLower = ".lnk" Then MsgBox(file.Extension)

And forget Regex for this. It's really overkill and inappropriate

like image 83
Steve Avatar answered Oct 19 '25 02:10

Steve