| java.lang.Object com.protomatter.util.StringUtil
StringUtil | public class StringUtil (Code) | | Utility methods for manipulating strings.
|
pad | public static void pad(StringBuffer b, String s, int n)(Code) | | Makes sure that a string has no more than n characters,
and pads it with spaces if it does.
|
pad | public static String pad(String s, int n)(Code) | | Makes sure that a string has no more than n characters,
and pads it with spaces if it does.
|
truncate | public static String truncate(String s, int n)(Code) | | Truncate a string to the given length.
If s.length() <= n, returns s.
Else, returns the first n characters of s.
|
truncateNicely | public static String truncateNicely(String s, int n)(Code) | | Nicely truncate a string.
Truncates s to n chars breaking s on whitespace,
and adding a "..." to the end.
|
|
|