Skip to main content

Practice ยท 2 of 4

Case-insensitive extension check

CHALLENGE
Difficulty: beginner+25 XP

Implement static bool HasExtension(string fileName, string ext) โ€” true when fileName ends with ext ignoring letter case. HasExtension("photo.JPG", ".jpg") is true. Null on either side yields false.

Back to lesson: Practice: Text workshop