Android String Sub String Get getTailorString(String string, int length)

Here you can find the source of getTailorString(String string, int length)

Description

get Tailor String

Declaration

public static String getTailorString(String string, int length) 

Method Source Code

//package com.java2s;

public class Main {
    public static String getTailorString(String string, int length) {

        if (string == null) {
            return null;
        }//from   w  w w .j a va 2 s .c  om

        if (string.length() <= length)
            return string;

        StringBuilder sb = new StringBuilder(
                string.substring(0, length - 1));
        sb.append(".");
        sb.append(".");
        sb.append(".");
        return sb.toString();
    }
}

Related

  1. left(String str, int length)
  2. right(String str, int length)
  3. delSuffix(String str)
  4. deleteLast(String str, int num)
  5. deleteLastIf(String str, String eq_str)
  6. mid(String str, int beginIndex, int length)
  7. subStringByByte(String str, int startPos, int length)
  8. subStringByByte(String paramString, int beginIndex, int endIndex)
  9. subString(String source, String start, int offsetStart, String end, int offsetEnd)