code: public static String getPreferredDelimiter(String csvData) {
  
          String bestMatch = "";
          int bestMatchCount = 0;
          // find for each delimiter, how often it occures in the String csvData
          for (int i = 0; i < DELIMITERS.length; i++) {
              int currentCount = csvData.split(DELIMITERS[i]).length;
              if (currentCount > bestMatchCount) {
                  bestMatch = DELIMITERS[i];
                  bestMatchCount = currentCount;
              }
          }
          return bestMatch;
      }
docs: Returns the delimiter that most often occures in the CSV content and is therefore best applicable for the CSV data .<p>
  
  @param csvData the comma separated values
  
  @return the delimiter that is best applicable for the CSV data