public final class TextUtil
extends java.lang.Object
| Constructor | Description |
|---|---|
TextUtil() |
| Modifier and Type | Method | Description |
|---|---|---|
static java.lang.String |
hint(java.lang.String text) |
Create a hint of what the text is like.
|
static java.lang.String |
maxStringLength(int max,
java.lang.String raw) |
Smash a long string to fit within the max string length, by taking the middle section of the string and replacing them with an ellipsis "..."
|
public static java.lang.String hint(java.lang.String text)
Used by logging and error messages to get a hint of what the text is like.
text - the text to abbreviate, quote, and generally give you a hint of what the value is.public static java.lang.String maxStringLength(int max,
java.lang.String raw)
Examples: .maxStringLength( 9, "Eatagramovabits") == "Eat...its" .maxStringLength(10, "Eatagramovabits") == "Eat...bits" .maxStringLength(11, "Eatagramovabits") == "Eata...bits"
max - the maximum size of the string (minimum size supported is 9)raw - the raw string to smashCopyright © 1995–2018 Webtide. All rights reserved.