title: Why does the last cell I read from a csv file add a comma at the beginning of the last string I'm using as a value to set to a variable?
body: <pre><code>private void populateEmployees() throws FileNotFoundException
      {
          File loc = new File(employeesPath);
          Scanner read = new Scanner(loc).useDelimiter(&quot;,&quot;);
  
          while (read.hasNext())
          {
              String firstName = read.next();
              String lastName = read.next();
              String age = read.next();
              String gender = read.next();
              String startDate = read.next();
              String currentEmployee = read.next();
              int totalHours = read.nextInt();
              String hourlyPay = read.nextLine();
              hourlyPay = hourlyPay.substring(1,hourlyPay.length() - 1);
  
              Employee employee = new Employee(firstName, lastName, age, gender, startDate, currentEmployee, totalHours, Double.parseDouble(hourlyPay));
              employees.add(employee);
          }
  
          read.close();
      }
  </code></pre>
  <p>While I did find a solution I'm still confused as to why String hourlyPay is getting a comma added to the beginning of its string. Anyone care to offer some insight on this?</p>