Android String Cut cutoff(String value, int length)

Here you can find the source of cutoff(String value, int length)

Description

cutoff

Declaration

public static String cutoff(String value, int length) 

Method Source Code

//package com.java2s;

public class Main {
    public static String cutoff(String value, int length) {
        if (isNullOrEmpty(value) == false && value.length() > length) {
            return value.substring(0, length - 1) + "..";
        }//from   w  w w .j a  va  2s. c  om

        return value;
    }

    public static boolean isNullOrEmpty(String input) {
        if (input == null) {
            return true;
        }

        return input.trim().isEmpty();
    }
}

Related

  1. safeCutNoDot(String str, int length)
  2. cutString(String str, int length)
  3. cutString(String str, int length, String dot)
  4. cutStringFromChar(String str1, String str2, int offset)
  5. cutRight(final String srcStr, final String cutStr)
  6. cutString(String str, int length)
  7. cutString(String str, int length, String dot)
  8. cutStringFromChar(String str1, String str2, int offset)