Hi,
My problem is the comparision of two objects and the strings that they return (accessed through getters).
Object one parses a csv file for dates and when printed out through exampleObject.getDateTime() returns the string: "2010-03-26-10-54-06.471000"
Object two has its dateTime string set by the user. When I set the dateTime on object two to be the same as objectOne and then do exampleObjectTwo.getDateTime() it returns 2010-03-26-10-54-06.471000
So the main difference is that one string has quotations from parsing the csv (which contains no quotations) and the user set string when returned has no quotations!
If anyone can offer an explanation as to why this is happening I'd be very grateful!
Many thanks!
BufferedReader input = new BufferedReader(new FileReader(file));
try {
String line = null;
while ((line = input.readLine()) != null) {
SearchResult searchResult = new SearchResult();
if (!line.contains("Date")) {
String[] split = line.split(",");
SearchResult.setDateTime(split[0]);
SearchResults.add(SearchResult);
}
}
} finally {
input.close();
}
} catch (IOException ex) {
ex.printStackTrace();
}
edit above is the code that was using to parse the csv file. I checked and the csv file does not contain any quotations.
Thanks for the quick and helpful response!