
I am comparing two strings, and apparently they aren't equal but they are. I was wondering what are some issues that could cause this, maybe datatype, hidden stuff that I can't see, or what. Any input could be helpful. Thanks.

I am comparing two strings, and apparently they aren't equal but they are. I was wondering what are some issues that could cause this, maybe datatype, hidden stuff that I can't see, or what. Any input could be helpful. Thanks.
String/Object comparison should use equals(), not == (excepts the case of String literal comparison)
Example:
if(string.equals(string2)){
}
== checks for reference equality, equals() checks for content equality. Read this discussion.
field.trim().equalsIgnoreCase("formDateCreated")
Try this. String trim() Method returns a copy of the string, with leading and trailing whitespace omitted.
use .equals() method to check for String equality like field1.equals("formDateCreated").
== operator just checks if two reference variables refer to the same string instance. equals() method checks if two strings are meaningfully equal.
equalsIgnoreCase(String anotherString)
for when you are not consider about case. This check weather your string content is equal not the reference which is ==
I would suggest you to check like bellow
"formDateCreated".equalsIgnoreCase(field)
So that it helps you to overcome possible NullPointerException