Skip to content

Commit

Permalink
Fix cut string with ascii
Browse files Browse the repository at this point in the history
  • Loading branch information
sauvank committed Feb 27, 2020
1 parent 6c6dbfb commit 27b1a9e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ConsoleTable/Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down

0 comments on commit 27b1a9e

Please sign in to comment.