Skip to content

Commit

Permalink
Utils.truncate
Browse files Browse the repository at this point in the history
  • Loading branch information
brmeyer committed Jun 28, 2024
1 parent 3787fd1 commit 92926f6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/main/java/com/impactupgrade/nucleus/util/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public static String trim(String s) {
}

public static String truncate(String s, int maxChars) {
if (s == null) return null;
return s.length() > maxChars ? s.substring(0, maxChars - 1) + "..." : s;
}

Expand Down

0 comments on commit 92926f6

Please sign in to comment.