You need to sign in to do that
Don't have an account?
Matthias Guenther
Strings not matching -- but show equal in debug log
Hi all:
I have the following debug statement:
but somehow my variable "f" and "currentHeader" don't seem to be mantched:
The data is coming from a csv file and I am cleaning the string with
String currentHeader = header[k].toLowerCase().trim().unescapeCsv();
also this method is called via a @future method.
I must be overlooking something. Any sugestions is appriciated.
I have the following debug statement:
for(String f: sfields.keySet()){ System.debug('~~~keySet f: ' + f +',\n ~~~f/currentHeader: -' + f + '-/-' + currentHeader +'-' +',\n ~~~currentHeader.difference(f): ' + currentHeader.difference(f) +',\n ~~~f.contains(currentHeader): ' + f.contains(currentHeader) +',\n ~~~sfields.containsKey(f): ' + sfields.containsKey(f) +',\n ~~~ sfields.get(f): ' + sfields.get(f) +',\n ~~~ sfields.containsKey(currentHeader): ' + sfields.containsKey(currentHeader)); Schema.SObjectField sf = sfields.get(f) ; Schema.SObjectField sf2 = sfields.get(currentHeader) ; }
but somehow my variable "f" and "currentHeader" don't seem to be mantched:
13:56:57.337 (1337502663)|SYSTEM_METHOD_ENTRY|[141]|System.debug(ANY) 13:56:57.337 (1337512569)|USER_DEBUG|[141]|DEBUG|~~~keySet f: employee_count__c, ~~~f/currentHeader: -employee_count__c-/-employee_count__c-, ~~~currentHeader.difference(f): employee_count__c, ~~~f.contains(currentHeader): false, ~~~sfields.containsKey(f): true, ~~~ sfields.get(f): Employee_Count__c, ~~~ sfields.containsKey(currentHeader): false 13:56:57.337 (1337524375)|SYSTEM_METHOD_EXIT|[141]|System.debug(ANY)I would expect f.contains(currentHeader) to be true, but it comes back as false.
The data is coming from a csv file and I am cleaning the string with
String currentHeader = header[k].toLowerCase().trim().unescapeCsv();
also this method is called via a @future method.
I must be overlooking something. Any sugestions is appriciated.
f = employee_count__c
currentHeader = -employee_count__c-
f.cotains(currentHeader) should be false.
but currentheader.contains(f) should be true;