src/Common/TextUtils.php
public static function countChars(string $text, bool $includeSpaces = false): int
    {
        if ($includeSpaces === false) {
            $text = preg_replace("/[\s]/", '', $text);
        }
        return mb_strlen($text);
    }
public static function countChars(string $text, bool $includeSpaces = false): int
    {
        if ($includeSpaces === false) {
            $text = preg_replace("/[\s]/", '', $text);
        }
        return mb_strlen($text);
    }
public static function countChars ( string $ text , bool $ includeSpaces = false ) : int { if ( $ includeSpaces === false ) { $ text = preg_replace ( "/[\s]/" , '' , $ text ) ; } return mb_strlen ( $ text ) ; }
Count the number of characters in a text
@param string $text
@param bool $includeSpaces
@return int
Count the number of characters in a text