Android String Shorten truncateAt(String string, int length)

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

Description

truncate At

Declaration

public static String truncateAt(String string, int length) 

Method Source Code

//package com.java2s;

public class Main {
    public static String truncateAt(String string, int length) {
        return string.length() > length ? string.substring(0, length)
                : string;/*ww  w  .  jav a2  s .c  o  m*/
    }
}

Related

  1. addEllipsis(String src, String ellipsis, int maxLength)
  2. toLength(String str, int length)
  3. truncate(String text, int length)
  4. curtail(String str, int size, String tail)
  5. truncateString(String resource, String startTag, String endTag)
  6. truncateAtMaxLength(String source, int maxLength, boolean addEllipsis)
  7. shortenString(String str, int length)