Android String Cut safeCut(String str, int length)

Here you can find the source of safeCut(String str, int length)

Description

safe Cut

Declaration

static String safeCut(String str, int length) 

Method Source Code

//package com.java2s;

public class Main {
    static String safeCut(String str, int length) {
        if (str.length() > length) {
            return str.substring(0, length) + "...";
        }// w  w w  .  jav a 2 s . c  o  m
        return str;
    }
}

Related

  1. cutString(String source, String output, int slength)
  2. cutString(String source, int slength)
  3. cutText(String text, int maxLength)
  4. safeCutNoDot(String str, int length)
  5. cutString(String str, int length)
  6. cutString(String str, int length, String dot)
  7. cutStringFromChar(String str1, String str2, int offset)