Java String Length Get lengthFormat(String str, int maxLength)

Here you can find the source of lengthFormat(String str, int maxLength)

Description

length Format

License

Apache License

Declaration

public static String lengthFormat(String str, int maxLength) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {

    public static String lengthFormat(String str, int maxLength) {
        return str.length() > maxLength ? str.substring(0, maxLength) + "..." : str;
    }/*from  ww  w  . j a  va 2s. c om*/
}

Related

  1. lengthConstToString(int val, int len)
  2. LengthConversionFactor(String OldUnits)
  3. lengthExpandedTabs(String string, int toIdx, int tabWidth)
  4. lengthExpression(final String operand, final long length)
  5. lengthField(String propertyName)
  6. lengthIfAllAlpha(String str)
  7. lengthIntegers(String str)
  8. lengthMinusColors(String thisStr)
  9. lengthMinusTrailingWhitespace(String line)