Java Utililty Methods String Ellipse

List of utility methods to do String Ellipse

Description

The list of methods to do String Ellipse are organized into topic(s).

Method

doubleellipseCircum(double a, double b)
Returns the approximate circumference of the ellipse defined by the specified minor and major axes.
return Math.PI * (3 * a + 3 * b - Math.sqrt((a + 3 * b) * (b + 3 * a)));
doubleellipseCircumference(double a, double b)
Estimate the circumference of an ellipse.
if (a + b == 0)
    return 0;
double aDb = a - b;
double aPb = a + b;
double diffSumQuotSq3 = 3 * (aDb / aPb) * (aDb / aPb);
double dividend1 = diffSumQuotSq3;
double divisor1 = 10 + Math.sqrt(4 - diffSumQuotSq3);
return Math.PI * (a + b) * (1 + dividend1 / divisor1);
...
StringellipseString(StringBuilder builder, int maxLength)
ellipse String
String res;
if (builder.length() > maxLength) {
    res = builder.substring(0, maxLength - 4) + "...";
} else {
    res = builder.toString();
return res;
Stringellipsify(String message)
Adds an ellipsis to the end of a string, generally indicating that this string leads to another choice (like a dialog)
return message == null ? null : message + "..."; 
Stringellipsis(final String text, final int length)
Ellipsis.
return text == null ? ""
        : length == 0 ? text : text.length() > length ? text.substring(0, length - 3) + "..." : text;
Stringellipsis(final String text, int length)
ellipsis
if (text.length() <= length)
    return text;
return text.substring(0, length - 3) + "...";
Stringellipsis(String string, int length)
Return a string that contains the original string, limited to the given number of characters.
if (string.length() > length) {
    return string.substring(0, length - 3) + "...";
return string;
Stringellipsis(String text, int max)
ellipsis
if (text.length() <= max) {
    return text;
int end = text.lastIndexOf(' ', max - 1); 
return text.substring(0, end) + "...";
Stringellipsis(String text, int maxLength)
ellipsis
if (text == null)
    return null;
if (text.length() > maxLength) {
    return text.substring(0, maxLength) + "...";
} else {
    return text;
StringellipsisString(String string, int len)
ellipsis String
String name = string;
if (name.length() > len && (!name.contains(" "))) {
    name = name.substring(0, (len - 3));
    name += "...";
return name;