public static function getVisibleStringLength($string)
    {
        // remove escape characters
        $pattern     = '#' . static::ESCAPE_CHARACTER_REGEX . '#';
        $cleanString = preg_replace($pattern, '', $string);

        return strlen($cleanString);
    }