<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _clamp_string(self, row_item, column_index, delimiter=''):
 """Clamp `row_item` to fit in column referred by column_index. This method considers padding and appends the delimiter if `row_item` needs to be truncated. Parameters row_item: str String which should be clamped. column_index: int Index of the column `row_item` belongs to. delimiter: str String which is to be appended to the clamped string. Returns ------- str The modified string which fits in it's column. """

        width = (self._table.column_widths[column_index]
                 - self._table.left_padding_widths[column_index]
                 - self._table.right_padding_widths[column_index])

        if termwidth(row_item) <= width:
            return row_item
        else:
            if width - len(delimiter) >= 0:
                clamped_string = (textwrap(row_item, width-len(delimiter))[0]
                                  + delimiter)
            else:
                clamped_string = delimiter[:width]
            return clamped_string