parameters: (self, row, col, string, cell_format=None)
return_statement: return str_error
docstring: Write a string to a worksheet cell.
  
          Args:
              row:    The cell row (zero indexed).
              col:    The cell column (zero indexed).
              string: Cell data. Str.
              format: An optional cell Format object.
  
          Returns:
              0:  Success.
              -1: Row or column is out of worksheet bounds.
              -2: String truncated to 32k characters.
docstring_summary: Write a string to a worksheet cell.
docstring_tokens: Write a string to a worksheet cell .
function: def write_string(self, row, col, string, cell_format=None):
          """
          Write a string to a worksheet cell.
  
          Args:
              row:    The cell row (zero indexed).
              col:    The cell column (zero indexed).
              string: Cell data. Str.
              format: An optional cell Format object.
  
          Returns:
              0:  Success.
              -1: Row or column is out of worksheet bounds.
              -2: String truncated to 32k characters.
  
          """
          str_error = 0
  
          # Check that row and col are valid and store max and min values.
          if self._check_dimensions(row, col):
              return -1
  
          # Check that the string is < 32767 chars.
          if len(string) > self.xls_strmax:
              string = string[:self.xls_strmax]
              str_error = -2
  
          # Write a shared string or an in-line string in optimisation mode.
          if self.optimization == 0:
              string_index = self.str_table._get_shared_string_index(string)
          else:
              string_index = string
  
          # Write previous row if in in-line string optimization mode.
          if self.optimization and row > self.previous_row:
              self._write_single_row(row)
  
          # Store the cell data in the worksheet data table.
          self.table[row][col] = cell_string_tuple(string_index, cell_format)
  
          return str_error
function_tokens: def write_string ( self , row , col , string , cell_format = None ) : str_error = 0 # Check that row and col are valid and store max and min values. if self . _check_dimensions ( row , col ) : return - 1 # Check that the string is < 32767 chars. if len ( string ) > self . xls_strmax : string = string [ : self . xls_strmax ] str_error = - 2 # Write a shared string or an in-line string in optimisation mode. if self . optimization == 0 : string_index = self . str_table . _get_shared_string_index ( string ) else : string_index = string # Write previous row if in in-line string optimization mode. if self . optimization and row > self . previous_row : self . _write_single_row ( row ) # Store the cell data in the worksheet data table. self . table [ row ] [ col ] = cell_string_tuple ( string_index , cell_format ) return str_error