Return a copy of string converted to case.

        Parameters
        ----------
        string : `str`

        Returns
        -------
        `str`

        Examples
        --------
        >>> CharCase.LOWER.convert('sTr InG')
        'str ing'
        >>> CharCase.UPPER.convert('sTr InG')
        'STR ING'
        >>> CharCase.TITLE.convert('sTr InG')
        'Str ing'
        >>> CharCase.PRESERVE.convert('sTr InG')
        'sTr InG'

def convert(self, string):
        """Return a copy of string converted to case.

        Parameters
        ----------
        string : `str`

        Returns
        -------
        `str`

        Examples
        --------
        >>> CharCase.LOWER.convert('sTr InG')
        'str ing'
        >>> CharCase.UPPER.convert('sTr InG')
        'STR ING'
        >>> CharCase.TITLE.convert('sTr InG')
        'Str ing'
        >>> CharCase.PRESERVE.convert('sTr InG')
        'sTr InG'
        """
        if self == self.__class__.TITLE:
            return capitalize(string)
        if self == self.__class__.UPPER:
            return string.upper()
        if self == self.__class__.LOWER:
            return string.lower()
        return string