Question
Case Sensitivity You need to get the collection to ignore case sensitivity on the key. In this Try It Out, you do this by ensuring
Case Sensitivity
You need to get the collection to ignore case sensitivity on the key. In this Try It Out, you do this by ensuring that whenever you save a key, you transform the email address into all lowercase characters. Whenever you perform a lookup based on a key, you transform whatever you search for into lowercase characters, too. All the code for this Try It Out is in the code folder Structure Demo in the Zip file for this chapter.
1. Return to Visual Studio 2015, open the Code Editor for the CustomerCollection class and make the bolded change to the Add method:
2. Find the overloaded Item property that takes an email address and modify the code as shown here:
3. Find the Remove method and modify the code as shown here:
4. Run the project and click the List Customer button. Now if you enter a valid email address in all uppercase characters, the lookup will still work.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started