Skip to content

Commit

Permalink
Truncate help add method and suffix (#19425)
Browse files Browse the repository at this point in the history
  • Loading branch information
nadar committed Jun 2, 2022
1 parent e21cbb5 commit 1f59b72
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions framework/helpers/BaseStringHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ public static function dirname($path)
* Truncates a string to the number of characters specified.
*
* In order to truncate for an exact length, the $suffix char length must be counted towards the $length. For example
* to have a string which is exactly 255 long with $suffix `...` then `StringHelper::($string, 252)` must be used to ensure
* you have 255 long string afterwards.
* to have a string which is exactly 255 long with $suffix `...` of 3 chars, then `StringHelper::truncate($string, 252, '...')`
* must be used to ensure you have 255 long string afterwards.
*
* @param string $string The string to truncate.
* @param int $length How many characters from original string to include into truncated string.
Expand Down

0 comments on commit 1f59b72

Please sign in to comment.