diff options
author | Jonas Kohl | 2024-09-13 19:57:43 +0200 |
---|---|---|
committer | Jonas Kohl | 2024-09-13 19:57:43 +0200 |
commit | 93817fef3ead7cfd4fcde25ea2bcec02d01310a4 (patch) | |
tree | 60f6ab69bbf2360d7cc518023090b8bf61bfd5b1 /src/application/mystic/forum/utils/StringUtils.php | |
parent | 086e2d2668784469ec114f6e6fd2b3dace3d7c3b (diff) |
A lot of changes again
Diffstat (limited to 'src/application/mystic/forum/utils/StringUtils.php')
-rw-r--r-- | src/application/mystic/forum/utils/StringUtils.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/application/mystic/forum/utils/StringUtils.php b/src/application/mystic/forum/utils/StringUtils.php index 7d4bf9d..fd38915 100644 --- a/src/application/mystic/forum/utils/StringUtils.php +++ b/src/application/mystic/forum/utils/StringUtils.php @@ -21,4 +21,8 @@ final class StringUtils { return ltrim($result, '_'); } + + public static function truncate(string $str, int $maxLength, string $ellipsis = "…"): string { + return mb_strimwidth($str, 0, $maxLength, $ellipsis); + } } |