system/CLI/CLI.php
public static function strlen(?string $string): int
	{
		if (is_null($string))
		{
			return 0;
		}
		foreach (static::$foreground_colors as $color)
		{
			$string = strtr($string, ["\033[" . $color . 'm' => '']);
		}

		foreach (static::$background_colors as $color)
		{
			$string = strtr($string, ["\033[" . $color . 'm' => '']);
		}

		$string = strtr($string, ["\033[4m" => '', "\033[0m" => '']);

		return mb_strlen($string);
	}
public static function strlen(?string $string): int
	{
		if (is_null($string))
		{
			return 0;
		}
		foreach (static::$foreground_colors as $color)
		{
			$string = strtr($string, ["\033[" . $color . 'm' => '']);
		}

		foreach (static::$background_colors as $color)
		{
			$string = strtr($string, ["\033[" . $color . 'm' => '']);
		}

		$string = strtr($string, ["\033[4m" => '', "\033[0m" => '']);

		return mb_strlen($string);
	}
Get the number of characters in string having encoded characters
and ignores styles set by the color() function

@param ?string $string

@return integer