public static String[] splitCSV(String inputString)
  {
    ArrayList<String> stringList = new ArrayList<String>();
    String tempString;
    StringBuilder sb = new StringBuilder();
    for (int i = 0; i < inputString.length(); i++)
      {
        if (inputString.charAt(i) == '"')
          {
            i++;
            while (i < inputString.length())
              {
                if (inputString.charAt(i) == '"'
                    && inputString.charAt(i + 1) == '"') //when there are two double quotation mark next to each other
                  {
                    sb.append('"');
                    i = i + 2;
                  }
                if (inputString.charAt(i) == '"')
                  {
                    break;
                  }
                else
                  {
                    sb.append(inputString.charAt(i));
                    i++;
                  }
              }
            i++; // skip over the double quotation mark
          }

        if (inputString.charAt(i) != ',')
          {
            sb.append(inputString.charAt(i));
          }// if
        else
          {
            tempString = sb.toString();
            stringList.add(tempString);
            sb.setLength(0);
          }// else
      }// for

    // After reaching the last character of the string, we need to do the
    // following
    tempString = sb.toString();
    stringList.add(tempString);
    sb.setLength(0);

    String[] stockArr = new String[stringList.size()];
    stockArr = stringList.toArray(stockArr);
    return stockArr;
  }// splitCSV