You need to sign in to do that
Don't have an account?
AKum
String comparison is failing in Salesforce ?
Hi Guys,
- We are having some weird issue while comparing two strings in apex class :
- We have a list of strings in which we store csv file headers after parsing that in salesforce.
- Then we compare each of these headers value in salesforce . In some situation we are getting same debug's for both string values but
- The check of STRING.EQUALSIGNORECASE is failing.
- I have assumed that the value in either of the string may contain some garbage or value of other type but not sure .
Although "EQUALSIGNORECASE" is not case sensitive, it is whitespace sensitive. Try trimming your strings before comparing them. Hope this helps.
Kindly mark this as solved if the reply was helpful.
Thanks,
Nagendra