You need to sign in to do that
Don't have an account?
Salesforce Beginner
How to handle the ignore case in strings
Hello All,
I am using a Map<string,List<string>> mapEmailtoBodyFields = new Map<string,List<string>>(); to map the email ids to description fields of an object.
Requirement : Have to check whether email id is present in our system. if present I have to do some logic. my question is, when I am comparing email in the map with the email ids in the system (our salesforce org), I might run into a case mismatch. For example:
key in the map : John.Doe@xyz.com
Email Id in the system : john.doe@xyz.com
When I am comparing these two,it should not fail because both the email ids are same. How can I make sure to compare this case sensitivity. I do not need a boolean result because, I am using map.get(emailID) .Please share your thoughts.
I am using a Map<string,List<string>> mapEmailtoBodyFields = new Map<string,List<string>>(); to map the email ids to description fields of an object.
Requirement : Have to check whether email id is present in our system. if present I have to do some logic. my question is, when I am comparing email in the map with the email ids in the system (our salesforce org), I might run into a case mismatch. For example:
key in the map : John.Doe@xyz.com
Email Id in the system : john.doe@xyz.com
When I am comparing these two,it should not fail because both the email ids are same. How can I make sure to compare this case sensitivity. I do not need a boolean result because, I am using map.get(emailID) .Please share your thoughts.
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_toLowerCase
All Answers
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_toLowerCase
That was very helpful :)