This is not a duplicate, I know how to compare strings, my problems is with using substring and split methods. I am not getting my desired output I have a java project where I am reading a csv that has the first 2 columns are populated.
1st column has a path to a image of a receipt. 2nd column has the reciept number.
Problem, i want to count the number of rows where the reciept # is blank. Unfortunately, my code is ignoring the blank cell.
while ((line = br.readLine()) != null) {
String recipetNum = null;
String[] splitLine = line.split(",", -1);
recipetNum = splitLine[2].substring(20,30).trim();
if (!recipetNum.matches("[0-9]+") || recipetNum.length() < 8 || recipetNum == "”){
//Add to error table
}