Task Three
Make Search Methods Case-Insensitive
You’ve completed your first two tasks!
Let’s assume you demonstrated the updated application for the Company Team, and
they noticed a feature that could be improved. When searching for jobs with
the skill "JavaScript"
some results were missing (e.g. the Watchtower
Security job on line 31 of the CSV file). The search methods turn out to be
case-sensitive, so they treat "JavaScript"
and "Javascript"
as different
strings.
The Company Team strongly requested that this needs to be fixed, and of course you told them that you are up to the task.
Here are some questions to ask yourself as you get started:
- Which methods are called when searching?
- How is the user’s search string compared against the values of fields of the job
Dictionary
objects? - How can you make this comparison in a way that effectively ignores the case of the strings?
- How can you do this without altering the capitalization of the items in
AllJobs
so that the data gets printed out the same way that it appears injob_data.csv
?
You might find it useful to review the String methods listed in the chapter.
When this task is completed, you’re ready to submit your assignment.