summaryrefslogtreecommitdiff
path: root/src/application/mystic/forum/utils/StringUtils.php
diff options
context:
space:
mode:
authorJonas Kohl <git@jonaskohl.de>2024-09-13 19:57:43 +0200
committerJonas Kohl <git@jonaskohl.de>2024-09-13 19:57:43 +0200
commit93817fef3ead7cfd4fcde25ea2bcec02d01310a4 (patch)
tree60f6ab69bbf2360d7cc518023090b8bf61bfd5b1 /src/application/mystic/forum/utils/StringUtils.php
parent086e2d2668784469ec114f6e6fd2b3dace3d7c3b (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.php4
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);
+ }
}