.. include:: ../substitutions
.. include:: ../../toolkit-substitutions

.. oe:namespace:: OESystem

.. meta::
   :keywords: OEStringTokenize

.. attention::

   |CPPONLY|

.. oe:function:: OEStringTokenize

   .. oe:api::

      bool OEStringTokenize(std::list<std::string>& strgrp,
                            const std::string& str,
                            const std::string & delim = " \t\n",
                            bool concat_delim = true)
      bool OEStringTokenize(std::vector<std::string>& strgrp,
                            const std::string& str,
                            const std::string & delim = " \t\n",
                            bool concat_delim = true)

   Break ups the specified input string ('str') into
   individual tokens based on the specified delimiters ('delim'). The
   resulting tokens are stored in the specified string group
   (strgrp). This function always returns ``true``. If *concat_delim*
   is ``true``, the default, consecutive delimiters will be treated as
   a single delimiter. For example, for parsing CSV files *concat_delim*
   should be set to ``false`` to allow for empty fields.

   .. seealso::

      .. oe:language:: c++

         * Example program :ref:`csv2sdf.cpp<section_example_oechem_csv2sdf>`

      .. oe:language:: python

         * Example program using Python csv package: :ref:`csv2sdf.py<section_example_oechem_csv2sdf>`

      .. oe:language:: java

         * Example program :ref:`CSV2SDF.java<section_example_oechem_csv2sdf>`

      .. oe:language:: csharp

         * Example program :ref:`CSV2SDF.cs<section_example_oechem_csv2sdf>`

