Java String Truncate truncate(String value, int length)

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

Description

truncate

License

Open Source License

Declaration

public static String truncate(String value, int length) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static String truncate(String value, int length) {
        return truncate(value, 0, length);
    }/*from w w w.j  a  v  a  2 s. c o  m*/

    public static String truncate(String value, int start, int length) {
        return value.substring(start, (value.length() < length ? value.length() : length));
    }
}

Related

  1. Truncate(String v, int length)
  2. truncate(String val, int maxlen)
  3. truncate(String value, int length)
  4. truncate(String value, int length)
  5. truncate(String value, int length)
  6. truncate(String value, int maxLen, String ellipses)
  7. truncate(String x, int length)
  8. truncateAndTrailOffText(String text, int limit)
  9. truncateAndTrim0(String str, String delim)