.. index:: 
  !StringDict.set Method
  
.. _id3_document_string_dict_set_class_method:

===============================================================================
StringDict.set Method
===============================================================================

Module: :ref:`StringDict<id3_document_string_dict_class>`

Definition
----------

Sets an item of the StringDict object.


.. tab-set::

    .. tab-item:: Python
      :sync: Python

      .. code:: Python

        set(self, key: str, item: str) -> None

      **Parameters**

        .. line-block::

          ``key`` str
          :guilabel:`in` Unique key of the  item to set.

          ``item`` str
          :guilabel:`in`  item to set.


      **Exceptions**

        .. line-block::

          :ref:`DocumentException<id3_document_document_exception>`
          An error has occurred during Document Library execution.


    .. tab-item:: Dart
      :sync: Dart

      .. code:: Dart

        void set(String? key, String? item)

      **Parameters**

        .. line-block::

          ``key`` String
          :guilabel:`in` Unique key of the  item to set.

          ``item`` String
          :guilabel:`in`  item to set.


      **Exceptions**

        .. line-block::

          :ref:`DocumentException<id3_document_document_exception>`
          An error has occurred during Document Library execution.


    .. tab-item:: C#
      :sync: C#

      .. code:: C#

        public void Set(string key, string item)

      **Parameters**

        .. line-block::

          ``key`` string
          :guilabel:`in` Unique key of the  item to set.

          ``item`` string
          :guilabel:`in`  item to set.


      **Exceptions**

        .. line-block::

          :ref:`DocumentException<id3_document_document_exception>`
          An error has occurred during Document Library execution.


    .. tab-item:: Java
      :sync: Java

      .. code:: Java

        public void set(String key, String item) throws DocumentException

      **Parameters**

        .. line-block::

          ``key`` String
          :guilabel:`in` Unique key of the  item to set.

          ``item`` String
          :guilabel:`in`  item to set.


      **Exceptions**

        .. line-block::

          :ref:`DocumentException<id3_document_document_exception>`
          An error has occurred during Document Library execution.


    .. tab-item:: Swift
      :sync: Swift

      .. code:: Swift

        public func set(key: String, item: String) throws

      **Parameters**

        .. line-block::

          ``key`` String
          :guilabel:`in` Unique key of the  item to set.

          ``item`` String
          :guilabel:`in`  item to set.


      **Exceptions**

        .. line-block::

          :ref:`DocumentException<id3_document_document_exception>`
          An error has occurred during Document Library execution.


    .. tab-item:: C
      :sync: C

      .. code:: C

        int id3DocumentStringDict_Set (
            ID3_DOCUMENT_STRING_DICT hStringDict, 
            const char * key, 
            const char * item)

      **Parameters**

        .. line-block::

          ``hStringDict`` :ref:`ID3_DOCUMENT_STRING_DICT<id3_document_string_dict_class>`
          :guilabel:`in` Handle to the StringDict object.

          ``key`` const char *
          :guilabel:`in` Unique key of the  item to set.

          ``item`` const char *
          :guilabel:`in`  item to set.


      **Returns**

        .. line-block::

          ``int``
          An error code.
          See :ref:`id3DocumentError<id3_document_document_error_enum>` file for the list of possible error codes.


