@staticmethod
def _trim_text_middle(val, maxw):
    """ Trim data by removing middle characters, so hello world' for 8 will become hel..rld.
            This kind of trimming seems to be better than tail trimming for user and database names.
        """
    half = int((maxw - 2) / 2)
    return val[:half] + '..' + val[-half:]
