From 27b1a9e815e8e6a92084e3ea966471a5f11ddc50 Mon Sep 17 00:00:00 2001 From: sauvank Date: Thu, 27 Feb 2020 17:28:40 +0100 Subject: [PATCH] Fix cut string with ascii --- src/ConsoleTable/Table.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ConsoleTable/Table.php b/src/ConsoleTable/Table.php index 3d88fb3..daf8809 100644 --- a/src/ConsoleTable/Table.php +++ b/src/ConsoleTable/Table.php @@ -123,7 +123,7 @@ private function lengthStr($str){ */ private function cutString(string $str, int $maxLength): string { $lengthStr = $this->lengthStr($str); - return $lengthStr > $maxLength ? substr_replace($str, "", $maxLength - $lengthStr) : $str; + return $lengthStr > $maxLength ? substr($str, 0, $maxLength) : $str; } /**