public final class Strings extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
truncate(String in,
int length) |
static String |
truncate(String in,
int length,
Optional<String> ellipsis)
Truncates the string
in to a string with maximal length
chars. |
public static String truncate(String in, int length)
in - The text to truncatelength - Length after which strings should be truncatedtruncate(java.lang.String, int, java.util.Optional)public static String truncate(String in, int length, Optional<String> ellipsis)
in to a string with maximal length
chars. If an ellipsis is given, the length of the ellipsis is taken into
account as well.
length.in - The text to truncatelength - The maximum lengthellipsis - An optional ellipsisin is longher than lengthCopyright © 2010–2016 michael-simons.eu. All rights reserved.